FCC - ES6 - Class Syntax - Constructor Function

by vanduzled

JavaScript

// Only change code below this line
class Vegetable{
  constructor(name){
    this.name = name;
  }
}
// Only change code above this line

const carrot = new Vegetable('carrot');
console.log(carrot.name); // Should display 'carrot'