Merge pull request #1830 from wonderingabout/add-js-formatting

fix missing js formatting
This commit is contained in:
Ilya Kantor 2020-04-03 01:50:27 +03:00 committed by GitHub
commit 5049c0b7d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,7 +231,7 @@ Remember when we talked about `Object.assign()` [in the past](https://javascript
It is possible to do the same thing with the spread operator! It is possible to do the same thing with the spread operator!
``` ```js run
let arr = [1, 2, 3]; let arr = [1, 2, 3];
let arrCopy = [...arr]; // spread the array into a list of parameters let arrCopy = [...arr]; // spread the array into a list of parameters
// then put the result into a new array // then put the result into a new array
@ -250,7 +250,7 @@ alert(arrCopy); // 1, 2, 3
Note that it is possible to do the same thing to make a copy of an object: Note that it is possible to do the same thing to make a copy of an object:
``` ```js run
let obj = { a: 1, b: 2, c: 3 }; let obj = { a: 1, b: 2, c: 3 };
let objCopy = { ...obj }; // spread the object into a list of parameters let objCopy = { ...obj }; // spread the object into a list of parameters
// then return the result in a new object // then return the result in a new object