kelas
//class in es6 are just functional constructor.
class PersonES6{
constructor(firstname,lastname,age){
this.firstname= firstname;
this.lastname=lastname;
this.age=age
}
aboutPerson(){
console.log(`My name is ${this.firstname} ${this.lastname} and I am ${this.age} years old`)
}
}
const shirshakES6= new Person('Shirshak','Kandel',25)
shirshakES6.aboutPerson();
Shirshak kandel