Indeepth: Inheritance with the prototype chain

These notes are for none else but me, because I need them for a bigger project. No time to explain...C# and javascript are completely different worlds.

let f = function () {
   this.a = 1;
   this.b = 2;
}
let o = new f(); // {a: 1, b: 2}

- you need the 'let' beause f.a will not exist.

- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
- https://stackoverflow.com/questions/728360/how-do-i-correctly-clone-a-javascript-object
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype
- https://stackoverflow.com/questions/11854958/how-to-call-a-parent-method-from-child-class-in-javascript
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
- https://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql