class Person {
isHuman = true;
constructor(name) {
this.name = name;
}
speak() {
console.log('Hello this is ' + this.name);
}
}
const pooya = new Person('Pooya');
pooya.speak();
// ✅
// we can change class property
pooya.isHuman = false;
// ✅ end
console.log(pooya.isHuman);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.