Classes are a template for creating something. It defines what properties and behaviors the object should have.

Homework

Code Runner Challenge

Create

View IPYNB Source
%%js

// CODE_RUNNER: Create


class Dog {
    bark() {
        console.log("Woof!");
    }

    eat() {
        console.log("Dog is eating.");
    }
}

let myDog = new Dog();

myDog.bark();
myDog.eat();

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...