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 trialBenjamin Hedgepeth
5,672 PointsBreaking down - String.prototype.toLowerCase()
Although it is mentioned that the .toLowerCase() method is applied to the object I still want to understand the "String.prototype" portion.
While researching this I found this website: https://adamscheller.com/javascript/prototypes-in-javascript-tutorial/
From what I comprehended, prototype is an object for which sets the baseline standard (or rules) from which compatible objects are derived from?
Is that correct?
1 Answer
Seth Kroger
56,413 PointsYou'll be going over prototypes when you get to Object-Oriented JavaScript which is a few courses down the track. JavaScript uses prototype-based inheritance, where new objects inherit methods from another concrete object instead of an abstract class. When an object doesn't have a requested method itself, it delegates to it's prototype (and it's prototype, and so on) until it finds that method. This is why methods in MDN usually have .prototype., because it's the technically correct way they're defined.