Tell us what’s happening:
I have passed the test, but I don’t understand why. What exactly is the spread operator?? This definition is given:
ES6 introduces the spread operator, which allows us to expand arrays and other expressions in places where multiple parameters or elements are expected.
But doesn’t show an actual example of it being used?? apply( )
and Math.max( )
are mentioned and used, but neither are defined. I’m not opposed to doing further work and research to understand something, I’ve had to do it multiple times going through these courses. It’s just so unhelpful when new information is included and not explained when you’re being taught/trying to learn.
I looked up apply( )
and Math.max( )
on w3schools and understand them. But I’m still left wondering: how do you actually use the spread operator? What does it look like?
Your code so far
const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY'];
let arr2;
arr2 = []; // Change this line
console.log(arr2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
.
Challenge: Use the Spread Operator to Evaluate Arrays In-Place
Link to the challenge: