Search⌘ K
AI Features

Challenge: ES6 Classes

Explore object-oriented programming in JavaScript by converting a problem code into ES6 classes. This challenge helps you understand class syntax, resolve errors, and strengthen your coding skills in a practical way.

We'll cover the following...

Problem statement

Study and then run the code below.

Javascript (babel-node)
function Cat (name) {
this.name = name
}
Cat.meow = function () {
console.log(this.name + ' says meow')
}
let catty = new Cat('catty')
catty.meow()

You’ll get an error when you run it. Your task ...