JS Built-ins
Promiseallbeginner

Promise.all([]) β€” typeof

πŸ“– Usage Example
const p1 = Promise.resolve(1)
const p2 = Promise.resolve(2)
Promise.all([p1, p2]).then(values => {
  console.log(values) // β†’ [1, 2]
})

Promise.all() waits for all promises to resolve and returns their values as an array.

typeof Promise.all()

typeof Promise.all([]) is 'object'.

Challenge: Verify the return type.

πŸ’‘ Hints (1)
  • β€’ Promise instances are objects.