Concatenate Arrays with concats

Concatenate Arrays with concats
0.0 0

#1

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:


#2

What did you try so far?


#3

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


#4

It’s just adding two arrays together.

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


#5

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;


#6

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).


#7

yessss , than u very very much