Javascript | Javascript kata |Node JS | Data Types | Variables | Control Flow | Scope and Environment | Objects | Functions | Events | Prototypal Inheritance | Three.js | 3DE Code Editor |
Prototypal Inheritance
prototype obj ^ | [[Prototype]] | obj
let earphones = { speakers: 2 }; let jbl = { bluetooth: true }; jbl.__proto__ = earphones; // sets jbl.[[Prototype]] to earphonesalternatively:
let jbl = { bluetooth: true, __proto__: earphones };
Sources, External Links
http:///wiki/?jsprototypalinheritance
12apr23 | admin |