Coggle requires JavaScript to display documents.
fullName
> Renay Earnshaw
class User { ... get fullName() { return `${this.#firstName} ${this.#lastName}`; } } ... console.log(user1.fullName);
class User { ... fullName() { return this.#firstName + " " + this.#lastName; }; }
class User { ... set fullName(fullName) { const [first, last] = fullName.split(" "); this.#firstName = first; this.#lastName = last; } }
User
class User { static description = "A user of the system"; ... }
user1
user2
description
> User.description
class AdminUser extends User { isAdmin = true; }
super
class AdminUser extends User { isAdmin = true; constructor(fName, lName) { super(fName, lName); this.state = "stressed"; } }
let user1 = new AdminUser("Renay", "Earnshaw");