what to use in javascript instead of class to call constructor 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');