const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {
// Only change code below this line
"use strict";
const [a, b,...arr] = list; // Change this line
// Only change code above this line
return arr;
}
const arr = removeFirstTwo(source);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36 Edg/90.0.818.42.
Challenge: Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements
Strict mode is a subset of rules for JS that, as the name imply, will run the code more strictly forbidding certain things that were previously allowed in JS.
Mainly it will throw errors for stuff that previously “failed” silently.
You can read all about it from the article I linked up top.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
“Strict mode” is a more restricted version of JavaScript, where make the code more resilient and secure in “strict mode”
some silent errors are changed to throw errors and disable some of the more confusing or undefined features in JavaScript.
For example,
Octal numeric literals are not allowed:
“use strict”;
var x = 010;