javascript tutorial 6
Sahifa ko'rinishi (5 sahifa)
Pastga aylantiring 👇
Ko'proq o'qimoqchimisiz?
Barcha 12 sahifani Telegram orqali bepul yuklab oling.
To'liq faylni yuklab olish"javascript tutorial 6" haqida
javascript tutorial 6 2. prototypes and inheritance javascript uses prototypal inheritance instead of classical inheritance. understanding prototypes is key to working with objects and inheritance in javascript. key concepts: prototype chain : every object in javascript has a prototype, and it can inherit properties and methods from its prototype. __proto__ vs. prototype : __proto__ refers to the prototype of an object, while prototype is used when defining constructor functions. class syntax : es6 introduced the class keyword, which is syntactic sugar over prototypal inheritance. example: function person(name) { this.name = name; } person.prototype.greet = function() { console.log(`hello, my name is ${this.name}`); }; const person1 = new person('alice'); person1.greet(); // output: hello,...
Bu fayl PPTX formatida 12 sahifadan iborat (242,2 KB). "javascript tutorial 6"ni yuklab olish uchun chap tomondagi Telegram tugmasini bosing.