We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Can We Update an Array using Spread Operator
Great Work on a blog, I've created a video about the following things :
- Array Destructing
- Array Spreading
- Object Destructing
- Object Spreading
Check out this ES6 features on https://www.youtube.com/wat...
Please Subscribe, Like and Share my channel to support. Thanks.
I think 3 point section "Spreading elements together with an individual element" ...name undefined right. let fruits = ['Apple','Orange','Banana'];
let newFruits = ['Cherry', ...fruits];
console.log(newFruits); // ['Cherry', 'Apple','Orange','Banana']
Please have a look. https://uploads.disquscdn.c...
let fruits = ['Apple','Orange','Banana'];
let newFruits = ['Cherry', ...names];
console.log(newFruits);
Uncaught SyntaxError: Identifier 'fruits' has already been declared
Cool article!
I think that you forgot a console.log() in your fifth snippet of code
Thanks :)
Really helpful about spread operator