Added solution (#27077)

This commit is contained in:
Alan Price
2019-01-24 20:36:57 +00:00
committed by Paul Gamble
parent 6a777a9b16
commit 1a6e1e57cc

View File

@ -69,6 +69,19 @@ console.log(carrot.name); // => should be 'carrot'
<section id='solution'>
```js
// solution required
function makeClass() {
"use strict";
/* Alter code below this line */
class Vegetable {
constructor(name){
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'
```
</section>