- Open your command-line application and navigate to your workspace.
- Create a new folder named 3-06-using-promise-all.
- Copy or create an index.html that loads and runs a main function from main.js.
- Create a main.js file that creates an object named rocket, and calls Promise.all with an empty array as the first argument:
export function main() { console.log('Before promise created'); const rocket = {}; Promise.all([]) console.log('After promise created'); }
- Create a function named addBoosters that creates an object with boosters to an object:
function addBoosters (rocket) { console.log('attaching boosters'); rocket.boosters = [{ count: 2, fuelType: 'solid' }, { count: 1, fuelType: 'liquid' }]; return rocket; }
- Create ...