In JavaScript classes, we put constructors inside of them as follows…
class Animal {
constructor(name){
this.name = name;
} }
let gorilla = new Animal(‘Bongo’);
console.log(gorilla.name);
The output would be “Bongo”. This syntax should be very familiar to those coming from traditional OO languages, such as C#.
Happy Coding!
Clay Hess