Classes in JavaScript are a template for creating objects. As we learned, unlike many other languages, it's easy to create JavaScript objects without classes, but that doesn't mean classes aren't useful.
class User {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const user = new User("Lane", 100);
class declaration creates a new classconstructor method is a special method that's called when a new instance of the class (object) is creatednew keyword calls the constructor method and creates a new instance of the classTextio messages include three properties:
recipient: The person receiving the message.sender: The person sending the message.body: The content of the message.Complete the Message class by adding a constructor that initializes these three properties.