كائنات جافاسكريبت Development Tutorials, Guides & Insights
Unlock 1+ expert-curated كائنات جافاسكريبت tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your كائنات جافاسكريبت skills on DeveloperBreeze.
Adblocker Detected
It looks like you're using an adblocker. Our website relies on ads to keep running. Please consider disabling your adblocker to support us and access the content.
Tutorial
javascript
البرمجة الكائنية (OOP) في JavaScript: المفاهيم الأساسية والتطبيقات
الوراثة هي مفهوم يسمح لك بإنشاء فئات جديدة بناءً على فئات موجودة. الفئة المشتقة (subclass) ترث الخصائص والأساليب من الفئة الأساسية (superclass).
class Animal {
constructor(name) {
this.name = name;
}
speak() {
console.log(`${this.name} يصدر صوتًا.`);
}
}
class Dog extends Animal {
speak() {
console.log(`${this.name} ينبح!`);
}
}
const myDog = new Dog("بلاك");
myDog.speak(); // بلاك ينبح!Sep 26, 2024
Read More