Concatenate Arrays with concats

Tell us what’s happening:

hi guys , could help me plzzzz

Your code so far

var oldArray = [1,2,3];
var newArray = [];

var concatMe = [4,5,6];

// Only change code below this line.

newArray = oldArray;

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/concatenate-arrays-with-concat

What did you try so far?

to be honest , I could not understand the concept , so i could not find any strategy to begin

It’s just adding two arrays together.

[a, b, c] + [d, e, f] = what do you think?

this is my trial
it does not work !

var oldArray = [1,2,3];
var newArray = [];

var concatMe = [4,5,6];

// Only change code below this line.
newArray = oldArray.concat(concatMe);

newArray = oldArray;

Nice!
At the very end you have newArray = oldArray; which is going to mess up what you did in the previous line! If you take it away I believe you’ll be okay!

I think in the original script they had newArray = oldArray; written and all you needed to do was change that exact line (by appending a method to oldArray).

1 Like

yessss , than u very very much

1 Like