Edit this. https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift

Tell us what’s happening:
myArray should now have [[“Paul”, 35], [“dog”, 3]].
should be
myArray` should now have [[“Paul”, 35],[“John”, 23], [“dog”, 3]].
it is written wrong in the challenge it is confusing for beginners so they think it removes first item and add another one

Your code so far


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

// Only change code below this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36.

Challenge: Manipulate Arrays With unshift()

Link to the challenge:

1 Like

it’s right what’s written, this line removes an item from the array

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.