Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
220,450 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.