- Open your command line application and navigate to your workspace.
- Create a new folder named 08-08-passing-class-as-an-argument.
- Copy or create an index.html that loads and runs a main function from main.js.
- Create a main.js file that defines a new class named Rocket:
// main.js class Rocket { constructor(name) { this.name = name; }}
- Create a class named InactiveRocket that extends the Rocket class and assigns a name and a lastFlow property in the constructor:
// main.js class InactiveRocket extends Rocket { constructor(name, lastFlown) { super(); this.lastFlown = lastFlown; } }
- Create a function isA that takes an instance and a klass argument and returns true if the constructor is the passed class:
// main.js function ...