Use class Syntax to Define a Constructor Functio

Tell us what’s happening: = name will not pass the last test, however = vegetable will…???

Your code so far

function makeClass() {
  "use strict";
  /* Alter code below this line */
class Vegetable {
  constructor(Vegetable){ = name ; 
  /* Alter code above this line */
  return Vegetable;
const Vegetable = makeClass();
const carrot = new Vegetable('carrot');
console.log(; // => 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:

Well sure - = name; will fail, because you haven’t created any variable named name. with the constructor,

class Vegetable {
    // here, you've created a variable named Vegetable by using that
    //   as a parameter in the constructor.  = Vegetable;
    // this could potentially be confusing, as you have a class and a
    //   variable with the same name, and case, and everything.
  //  the rest of Vegetable

So in that, the constructor gets a parameter, which you are calling Vegetable. If you wanted to do = name, then simply change the parameter in the constructor from Vegetable to name.

ok now I got it, thanks man