Tell us what’s happening:
this.name = name will not pass the last test, however this.name = vegetable will…???
Your code so far
function makeClass() {
"use strict";
/* Alter code below this line */
class Vegetable {
constructor(Vegetable){
this.name = name ;
}
}
/* Alter code above this line */
return Vegetable;
}
const Vegetable = makeClass();
const carrot = new Vegetable('carrot');
console.log(carrot.name); // => should be 'carrot'
Your browser information:
User Agent is: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function/