functions in constructor class code example
Example: ES6: Use class Syntax to Define a Constructor Function
class Vegetable {
constructor(name) {
this.name = name;
}
}
const carrot = new Vegetable('carrot');
class Vegetable {
constructor(name) {
this.name = name;
}
}
const carrot = new Vegetable('carrot');