Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Removing Items From Arrays

Cody Norman
seal-mask
.a{fill-rule:evenodd;}techdegree
Cody Norman
Full Stack JavaScript Techdegree Student 3,421 Points

Removing Items From Arrays

In the video Dave goes to MDN and uses the console on MDN to instruct the video. I can pull up the console using both Ctrl+Shift+J and using the "More Tools -> Developer Tools" in Google Chromes options menu but when I try to follow along with the video I can't replicate his results, specifically after he sets up the "var nums = (1, 2, 3, 4, 5)" next he does nums.length and that's where thing go wrong, I get undefined rather then the length of nums. The nums.pop() doesn't work either returning undefined also. So either there is a different Chrome that I don't know about or MDN/Chrome has had an update that makes this video irreverent.

Can someone let me know what I'm doing wrong if its on my end.

var nums = [1, 2, 3, 4, 5];
nums.length //5

1 Answer

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 37,799 Points

It does work for me

var nums = [1,2,3,4,5];
undefined
nums.length
5
nums.length //5
5
nums.pop();
5

You might want to try upgrading Chrome to the latest version. BTW it doesn't matter what web page you are on. Anything you type in the console will run on any page for this exercise. I was on Google when I ran it.

Mark Sebeck
Mark Sebeck
Treehouse Moderator 37,799 Points

Not a rookie mistake. That's a typo and we all make them. Glad you got it to work.