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
kennethortiz
5,825 PointsQuestion about _proto_
I noticed that proto was added to my object as an object. Is there something wrong with my code? I was trying to nest an array within an object (if that's possible)...
Thanks.
My Code:
var me = {
first_name: "Kenny",
last_name: "Ortiz",
"Employee Number": 1,
favorite_movies: ["LOTR", "Batman"]
}
console.log(me)
Output:
Object {first_name: "Kenny", last_name: "Ortiz", Employee Number: 1, favorite_movies: Array[2]} Employee Number: 1 favorite_movies: Array[2] first_name: "Kenny" last_name: "Ortiz" proto: Object
1 Answer
Claudio Atzori
6,061 PointsThere is nothing wrong with it: the console shows the prototype of the object you are calling. In this case the protoype of your object is the "general" Object, and clicking in the triangle beside it will show all the methods (the built-in functions you can call on it) it includes. (I hope this is useful despite of my english)
kennethortiz
5,825 Pointskennethortiz
5,825 PointsThank you Claudio!