scrimba
Learn Modern JavaScript
Use Destructuring Assignment with the Rest Operator to Reassign Array Elements
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Use Destructuring Assignment with the Rest Operator to Reassign Array Elements
AboutCommentsNotes
Use Destructuring Assignment with the Rest Operator to Reassign Array Elements
Expand for more info
index.js
run
preview
console
const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {

const arr = list;

return arr;
}
const arr = removeFirstTwo(source);
console.log(arr);
console.log(source);
Console
1
,
2
,
4
,
6
,
8
,
index.html
-1:21