Throws the provided error
The error to be thrown.
raise(new Error('This is an error')) Copy
raise(new Error('This is an error'))
Throw error if the condition is not met
const value = x ?? raise(new Error('x is undefined'))const value = x ? x : raise(new Error('x is falsey')) Copy
const value = x ?? raise(new Error('x is undefined'))const value = x ? x : raise(new Error('x is falsey'))
Throws the provided error