OOP
OOP (Object-Oriented Programming)
Class
class Car {
constructor(model) {
this.model = model;
}
getModel() {
return this.model;
}
getYear() {
return this.year;
}
setYear(year) {
this.year = year;
}
printDescription(){
console.log(`This is a car ${this.model}`);
}
}Object
Encapsulation
Inheritance (상속)
Polymorphism (다형)
Abstraction (추상화)
Last updated