Tell us what’s happening:
The following is the last sentence in the explanation of this exercise. Could someone use these “traditional methods” and show me how it would have been done without the spread operator?
Using spread syntax, we have just achieved an operation that would have been more more complex and more verbose had we used traditional methods.
Your code so far
function spreadOut() {
let fragment = ['to', 'code'];
let sentence = ["learning", ...fragment, "is", "fun"]; // change this line
return sentence;
}
// do not change code below this line
console.log(spreadOut());
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge: