- Open your command-line application, and navigate to your workspace.
- Create a new folder named 10-04-map-to-produce-values.
- Create a main.js file that defines a new class named Rocket that takes a constructor argument name and assigns it to an instance property:
// main.js class Rocket { constructor(name) { this.name = name; } }
- Create a main function that creates several Rocket instances and places them into an array:
// main.js export function main() { const saturnV = new Rocket('US: Saturn V'); const falconHeavy = new Rocket('US: Falcon Heavy'); const soyuz = new Rocket('USSR: Soyuz'); const dongFeng = new Rocket('CN: Dong Feng'); const longMarch = new Rocket('CN: Long March'); const rockets = [saturnV, falconHeavy, ...