[Some bug ] Use class Syntax to Define a Constructor Function

[Some bug ] Use class Syntax to Define a Constructor Function
0

#1

Tell us what’s happening:
Same issue as this post. [Some bug] Use getters and setters to Control Access to an Object

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.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function/


[Some bug] Use getters and setters to Control Access to an Object
#2

Thank you so much for reporting issues. Hopefully this one easier to fix.

This is great people help people, just like you reported the issues. Really appreciate it.


#3

It’s because the test cases are not written for the functionality of the program.