class Rectangle {
constructor(height, width) {
this.height = height;
this.width = width;
}
}
// unnamed
let Rectangle = class {
constructor(height, width) {
this.height = height;
this.width = width;
}
};
console.log(Rectangle.name);
// 출력: "Rectangle"
// named
let Rectangle = class Rectangle2 {
constructor(height, width) {
this.height = height;
this.width = width;
}
};
console.log(Rectangle.name);
// 출력: "Rectangle2"
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/get
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/set
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Classes/static

class PsersonCl {
constructor(fullName, birthYear) {
this.fullName = fullName;
this.birthYear = birthYear;
}
calcAge() {
...
}
greet() {
...
}
get age() {
return ...
}
set fullName(name) {
...
}
get fullName() {
return ...
}
static hey() {
...
}
}
class StudentCl extends PersonCl {
constructor(fullName, birthYear, course) {
super(fullName, birthYear);
this.course = course;
}
introduce() {
...
}
calcAge() {
...
}
}
const martha = new StudentCl('Martha Jones', 2012, 'Computer Science');
martha.introduce();
// StudentCl 클래스에서 재정의 된 calcAge 함수를 호출하게 됨
martha.calcAge();