I only used the class keyword. Didn’t setup the constructor method at all.
It still passed the test.
Your code so far
function makeClass() {
"use strict";
/* Alter code below this line */
class Vegetable {
}
/* 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 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.
It’s much easier to read than a screenshot. In this case, I can see the problem though: you need to define the constructor inside of a class, not the function.
And yes, it’s a little odd to see class used inside a function, but it does work (and for good reason)