June 2018
Beginner
288 pages
6h 31m
English
Here are the solutions to the Exercises, for the Chapter 10, Keeping Your Promises chapter.
No. Promise.race() will complete with the state of the first promise to complete. If the first resolves, then race() will resolve. If the first rejects, so will race().
No. If any of the candidate promise rejects, then all() will reject. However, if no candidate promise has rejected, then all() will resolve when all candidate promises resolve.
| | /* |
| | npm install fs-extra |
| | */ |
| | |
| | 'use strict'; |
| | |
| | const fs = require('fs-extra'); |
| | |
| | fs.readFile(__filename) |
| | .then(contents => console.log(contents.toString())) |
| | .catch(err => console.log(err.message)); |
| | 'use strict'; |
| | |
| | const fs = require( ... |
Read now
Unlock full access