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

The console.log of the skills array are not showing up as in the video

When I look through the console.log of the skills array, this is what i get skills : Array(3)0: "JavaScript"1: "HTML"2: "CSS"length: 3_proto_: Array(0).

How come? Can it have something to do with the browser? I am using Google Chrome however I do not know if it is the latest version. This is the code:

var person = { name : 'Sarah', country : 'US', age : 35, treehouseStudent : true, skills : ['JavaScript', 'HTML', 'CSS'] };

for(prop in person){ console.log(prop , ': ', person[prop]); }

1 Answer

Steven Parker
Steven Parker
229,921 Points

It sounds like they've added some fancy stuff to the console.log routine in the new version. It's still showing you the contents, but it's also including the indexes, and identifying the object type and prototype. Nice! I'll look forward to upgrading.