- Open your command-line application, and navigate to your workspace.
- Create a new folder named 10-01-using-find-and-filter.
- 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 abstract class named Rocket. Assign a name instance property upon construction:
// main.js class Rocket { constructor(name) { this.name = name; } }
- Create a main function that constructs several Rocket instances:
// main.js export function main() { const saturnV = new Rocket('US: Saturn V'); const falconHeavy = new Rocket('US: Falcon Heavy'); const longMarch = new Rocket('CN: Long March'); const rockets = [saturnV, falconHeavy, longMarch]; }
- Use the find method to locate the first ...