Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const source = [1,2,3,4,5,6,7,8,9,10];
- function removeFirstTwo(list) {
- "use strict";
- const [a, b, ...arr] = list; // change this
- return arr;
- }
- const arr = removeFirstTwo(source);
- console.log(arr); // should be [3,4,5,6,7,8,9,10]
- console.log(source); // should be [1,2,3,4,5,6,7,8,9,10];
Add Comment
Please, Sign In to add comment