Day 2: Prototypes & ES6 Classes
Daily Objective
Section titled “Daily Objective”Model entities using ES6 Classes, constructors, and inheritance with extends.
1. ES6 Classes
Section titled “1. ES6 Classes”class User { constructor(name, email) { this.name = name; this.email = email; } greet() { return `Hello, I am ${this.name}`; }}
class Admin extends User { constructor(name, email, permissions) { super(name, email); this.permissions = permissions; }}Daily Hands-on Practice (70%)
Section titled “Daily Hands-on Practice (70%)”- Model a
Vehiclebase class and extend it with aCarsubclass.