F.prototype thumbnail
F.prototype
javascript.info
Please note that F.prototype here means a regular property named "prototype" on F. Setting Rabbit.prototype = animal literally states the following: "When a new Rabbit is created, assign its [[Prototype]] to animal". If, after the creation, F.prototype property changes (F.prototype = <another object
3 Users
0 Comments
10 Highlights
0 Notes

Top Highlights

  • Please note that F.prototype here means a regular property named "prototype" on F.
  • Setting Rabbit.prototype = animal literally states the following: "When a new Rabbit is created, assign its [[Prototype]] to animal".
  • If, after the creation, F.prototype property changes (F.prototype = <another object>), then new objects created by new F will have another object as [[Prototype]], but already existing objects keep the old one.
  • We can use constructor property to create a new object using the same constructor as the existing one.
  • That’s handy when we have an object, don’t know which constructor was used for it (e.g. it comes from a 3rd party library), and we need to create another one of the same kind.

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.