HTML 4
HTML 4
- function sum(a, b, c) {
return a + b + c;
}
- const sumArrow = (a, b, c) => a + b + c;
2.class Employee {
constructor(firstName, lastName, age, phone, address) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.phone = phone;
this.address = address;
}
displayInfo() {
console.log(`Họ và tên: ${this.firstName} ${this.lastName}`);
console.log(`Tuổi: ${this.age}`);
console.log(`Số điện thoại: ${this.phone}`);
console.log(`Địa chỉ: ${this.address}`);
}
}
const employee1 = new Employee('Nguyễn', 'Văn A', 30, '0123456789', 'Hà Nội');
const employee2 = new Employee('Trần', 'Thị B', 25, '0987654321', 'TP.HCM');
employee1.displayInfo();
employee2.displayInfo()