Tell us what’s happening:
Describe your issue in detail here.
Example:
const ourArray = ["Stimpson", "J", "cat"];
ourArray.shift();
ourArray.unshift("Happy");
After the shift, ourArray would have the value ["J", "cat"]. After the unshift, ourArray would have the value ["Happy", "J", "cat"].
Add ["Paul", 35] to the beginning of the myArray variable using unshift().
Your code so far
// Setup
const myArray = [["John", 23], ["dog", 3]];
myArray.shift();
// Only change code below this line
myArray.unshift(["paul",35]);
console.log(myArray);
I did exactly what i was asked to do but i don’t see to know what is the problem. Can someone please help me out. ![]()
I have checked other forums but none seems to help me out. ![]()
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Manipulate Arrays With unshift Method
Link to the challenge: