...
Solution Review: ES6 Classes
This lesson will explain the solution to the problem in the previous lesson.
class Cat { constructor (name) { this.name = name } meow () { console.log(this.name + ' says meow') }}let catty = new Cat('catty') catty.meow()
This challenge tests your knowledge of OOP in the ES6 version of JavaScript.
The following code was provided to you:
function Cat (name) { this.name = name}Cat.meow = function () { console.log(this.name + ' says meow')}let catty = new Cat('catty')catty.meow()
Let’s figure out what the issue in this code was. From ...