Pop and Push don't affect what's printed


#1

https://www.codecademy.com/courses/learn-javascript/lessons/arrays/exercises/pop

So this works as far as the lesson is concerned, but the push and pop functions don't affect what's printed. It just goes through as the original array I created.

Any help is appreciated. I'm not stuck, but I feel like something's up if the lesson continues but nothing extra printed/got deleted.

var bucketList = ['Sun', 'Moon', 'Star'];
var listItem = bucketList[1];

console.log(bucketList);
bucketList.pop();

#2

Try your statements

in a different order
like

bucketList.pop();
console.log(bucketList);

#3

This worked! Thanks so much. I didn't think the order would've mattered.


#4

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