ENع
الدرس 15 · How JavaScript really works

Prototypes and classes

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Every JavaScript object has a hidden link to another object, its prototype. Reading a property the object does not have walks up these links until the property is found or the chain ends at null. Follow a nine-line script: a class Dog makes Dog.prototype, new makes two dogs linked to it, and three lookups find speak one link up, toString two links up, and fly nowhere.

11 دقيقة10 خطوات5 أسئلةIntermediate
شكل 15 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.