I did not understand this exercise. Anyone can explain me the solution below?
Your code so far
class Vegetable {
constructor(name) {
this.name = name;
}
}
const carrot = new Vegetable("carrot");
console.log(carrot.name); // => should be 'carrot'
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
.
Challenge: Use class Syntax to Define a Constructor Function
Link to the challenge: