Combine Arrays with the Spread Operator_002

Combine Arrays with the Spread Operator_002
0

#1

Tell us what’s happening:
So I am pretty sure that this is what it’s asking me to do. I used the spread operator to add the fragment array after the word “Learning”, and before , “is”, and “fun”
The spreadOut function returns Learning,to,code,is,fun.
but it keeps telling me that “spreadOut should return [“learning”, “to”, “code”, “is”, “fun”]”

I even tried changing the format to make it return exactly ‘[“learning”, “to”, “code”, “is”, “fun”]’

It’s not letting me pass. Does anyone know why?
Thank you for your time.
My code so far


function spreadOut() {
  let fragment = ['to', 'code'];
  let sentence = ["Learning", ...fragment, "is", "fun"]; // changing this line
  return sentence;
}

// do not change code below this line
console.log(spreadOut());

My browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/combine-arrays-with-the-spread-operator


#2

“Learning” should be “learning”. It passes with that change.


#3

Oh. my. gahhhh. I have been stuck on this for way too long. Thank you much. :slight_smile:


#4

You’re welcome. :slightly_smiling_face: Typos can be difficult to spot, especially if you’re been staring at the screen for hours. :neutral_face:


#5

Don’t I know it. :sweat_smile: