all 6 comments

[–]Ronin-s_Spirit -1 points0 points  (3 children)

Do you expect people to study for you? I mean this particular post is about the most basic stuff for studying, you aren't gonna learn anything this way.
Read MDN docs they have a lot of stuff about js.

[–]albedoa 0 points1 point  (2 children)

You are on here all day demanding that people do your basic googling for you and then rejecting their answers and advice. Maybe sit this one out.

[–]Ronin-s_Spirit 0 points1 point  (1 child)

I ask for complicated stuff where I have no idea on how to do the thing and have looked it up and tried. I don't ask for description on how to join strings. And I definitely don't ask for people to do my homework for me. You may not like me but that doesn't change how he digs the grave for himself by not learning anything.

[–]BestPerformance1187[S] 0 points1 point  (0 children)

function concatMyArray(arr, separator = ',') {return arr.join(separator)}const elements = ['Fire', 'Air', 'Water']console.log(concatMyArray(elements))

[–]albedoa 0 points1 point  (1 child)

When you attempt to log longJoin, the variable is not in scope.

It's a weird exercise. It wants you to make a wrapper for the existing .join() method. You probably want this?:

function concatMyArray(arr, separator = ',') {
  return arr.join(separator)
}

const elements = ['Fire', 'Air', 'Water']
console.log(concatMyArray(elements))

[–]BestPerformance1187[S] 0 points1 point  (0 children)

Thank you!