Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The newly created object has Object.prototype as its [[Prototype]]
- // It has no own property named 'hasOwnProperty'
- // hasOwnProperty is an own property of Object.prototype.
- // So it inherits hasOwnProperty from Object.prototype
- // Object.prototype has null as its prototype.
- // PROTOTYPE CHAIN : software ---> Object.prototype ---> null
- var software = {language: "JavaScript"};
- // Arrays inherit from Array.prototype
- // (which has methods indexOf, forEach, etc.)
- // PROTOTYPE CHAIN : frameworks ---> Array.prototype ---> Object.prototype ---> null
- var frameworks = ['React', 'Angular', 'Polymer'];
- // Functions inherit from Function.prototype
- // (which has methods call, bind, etc.)
- // PROTOTYPE CHAIN : websiteContent ---> Function.prototype ---> Object.prototype ---> null
- function websiteContent() {
- return "Hello World!";
- }
Add Comment
Please, Sign In to add comment