Manipulate Arrays With unshift

Manipulate Arrays With unshift
0

#1

Totally lost. Is this not the correct code? myArray.unshift(‘Paul’);

Manipulate Arrays With unshift

// Example
var ourArray = [“Stimpson”, “J”, “cat”];
ourArray.shift(); // ourArray now equals [“J”, “cat”]
ourArray.unshift(“Happy”);
// ourArray now equals [“Happy”, “J”, “cat”]

// Setup
var myArray = [[“John”, 23], [“dog”, 3]];
myArray.shift();

// Only change code below this line.

myArray.unshift(‘Paul’);


#2

It says

Add ["Paul",35] to the beginning of the myArray variable using unshift()

You were only unshifting 'Paul'


#3

I did that and the code still comes up wrong.


#4

Can you post your code?


#5

myArray.unshift(‘Paul’);
[


#6

I got it it. Thanks.

myArray.unshift([“Paul”,35]);