Created
June 24, 2018 23:35
-
-
Save toymachiner62/311b15e6aaad9e8c999b0d8b55883027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let promises = [] | |
let promise1 = new Promise((resolve, reject) => { resolve() }) | |
let promise2 = new Promise((resolve, reject) => { resolve() }) | |
promises.push(promise1, promise2) | |
Promise.all(promises) | |
.then(() => { | |
console.log('in then') | |
}) | |
.finally(() => { | |
console.log('in finally') | |
}) | |
// With Node 9.11.1 | |
// outputs: | |
// | |
// .finally(() => { | |
// ^ | |
// TypeError: Promise.all(...).then(...).finally is not a function | |
// at Object.<anonymous> (/Users/tomcaflisch/promise-all-finally-not-working.js:12:11) | |
// at Module._compile (internal/modules/cjs/loader.js:654:30) | |
// at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) | |
// at Module.load (internal/modules/cjs/loader.js:566:32) | |
// at tryModuleLoad (internal/modules/cjs/loader.js:506:12) | |
// at Function.Module._load (internal/modules/cjs/loader.js:498:3) | |
// at Function.Module.runMain (internal/modules/cjs/loader.js:695:10) | |
// at startup (internal/bootstrap/node.js:201:19) | |
// at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment