JS Class
JavaScript Class
Định Nghĩa Class
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
greet() {
console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
}
}Tạo Đối Tượng từ Class
Bài Tập Thực Hành
Last updated