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
brandonlind2
7,823 PointsDo all objects in javascript have a prototype?
I was told all objects need a prototype in js, however wouldnt the code below create an object without a prototype?
var obj=Object.create(null);
Do all objects have a prototype and null simply means it has no user created prototype? is there some native object that would still be its prototype?
1 Answer
Chyno Deluxe
16,936 PointsI'm not sure I completely understand your example but here is excerpt from w3Schools
Every JavaScript object has a prototype. The prototype is also an object.
All JavaScript objects inherit their properties and methods from their prototype.
I suggest you read through the link above to get a better understanding of Objects and prototype properties.
brandonlind2
7,823 Pointsbrandonlind2
7,823 PointsThanks man that's what I was looking for
brandonlind2
7,823 Pointsbrandonlind2
7,823 PointsThanks man that's what I was looking for