xxxxxxxxxx
21
let john = {
name: "John",
position: "Lecturer",
speak(){
console.log("hi");
}
}
console.log(john)
class People{
constructor(name, position){
this.name = name;
this.position = position;
}
speak(){
console.log("hi");
}
}
john = new People("John", "Lecturer");
console.log(john)