ES6 syntax allows for clean and simple addition of methods to a class. Under the hood of this class syntax, it creates a prototype method accessible to all new instances of this class.
Quick and simple! 🙃
Another way of adding a method to a constructor in ES5 is to use a prototype. -
The difference here is that you can specify which new instances will inherit this method. Really neat. 😊
What are your thoughts on adding a method via prototype v. inside a constructor?