--- id: 587d7b8b367417b2b2512b53 title: Use class Syntax to Define a Constructor Function challengeType: 1 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(typeof Vegetable === "function" && typeof Vegetable.constructor === "function", "Vegetable should be a class with a defined constructor method.");' - text: '' testString: 'getUserInput => assert(getUserInput("index").match(/class/g),"class keyword was used.");' - text: '' testString: 'assert(() => {const a = new Vegetable("apple"); return typeof a === "object";},"Vegetable can be instantiated.");' - text: '' testString: 'assert(carrot.name=="carrot","carrot.name should return carrot.");' ```
## Challenge Seed
```js function makeClass() { "use strict"; /* Alter code below this line */ /* Alter code above this line */ return Vegetable; } const Vegetable = makeClass(); const carrot = new Vegetable('carrot'); console.log(carrot.name); // => should be 'carrot' ```
## Solution
```js // solution required ```