JS Built-ins
Promiserejectbeginner

Promise.reject β€” typeof function

πŸ“– Usage Example
Promise.reject(new Error('failed'))
  .catch(err => {
    console.log(err.message) // β†’ 'failed'
  })

Promise.reject() creates an already-rejected promise with the given reason.

typeof Promise.reject

typeof Promise.reject is 'function'.

Challenge: Verify Promise.reject is a function.

πŸ’‘ Hints (1)
  • β€’ Promise.reject is a static method β€” a function on the Promise object.