Welcome to the Treehouse Community
Looking to learn something new?
Help!!! this is complicated
Dario Bahena10,697 Points
Imagine an apple. If you imagined a red one, someone else might have imagined a green one. When you pick an apple from a tree whatever color it may be, that is an instance of an apple. the prototype is a property that all instances of objects have that is shared among them. The prototype can be modified on the object itself and will affect all of the instances of that object but only in that special prototype property.
Array.prototype // this contains a bunch of methods including map, pop, push const foo = [1,2,3,4] foo.prototype // this will contain the same methods as Array.prototype Array.prototype.test = 'whatever' // the test property is now available to all arrays foo.test // this now works because it is part of the prototype and will be there in any array you create
Side note, this just illustrates a point. It is bad practice to mutate built in prototypes.