JS Built-ins
AggregateErrorbeginner

AggregateError β€” instanceof check

πŸ“– Usage Example
const err = new AggregateError([new Error('a'), new Error('b')], 'Two errors')
err.errors.length  // β†’ 2

AggregateError wraps multiple errors into a single error object.

AggregateError Constructor

new AggregateError([...errors], message) creates an AggregateError wrapping multiple errors.

Challenge: Verify that the result is an instance of AggregateError.

πŸ’‘ Hints (1)
  • β€’ AggregateError takes an iterable of errors as its first argument.