I did pass the challenge but still have trouble understanding the" class " session basically i have failed to understand the code. Thanks

Tell us what’s happening:

Your code so far

/* Alter code below this line */
class Vegetable{
    this.name = name;
/* Alter code above this line */

const carrot = new Vegetable('carrot');
console.log(carrot.name); // => should be 'carrot'

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.

Challenge: Use class Syntax to Define a Constructor Function

Link to the challenge: