Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
Well done!
You have completed (UPI) Chapter 7: Advanced JavaScript Object Handling!
Instruction
Classes and Constructors
JavaScript classes provide a syntactical sugar over the prototype-based inheritance model, making it easier to create objects and handle inheritance.
class Person {
constructor(name) {
this.name = name;
}
introduceSelf() {
console.log(`Hi! I'm ${this.name}`);
}
}
const giles = new Person("Giles");
giles.introduceSelf(); // Outputs: Hi! I'm Giles
This ...