AggregateError()
AggregateError() is a JavaScript function in the Error category. Groups multiple errors into one. The syntax is new AggregateError(errors, message). A typical example: new AggregateError([new Error("e1"), new Error("e2")], "Multiple errors"). A close sibling is Error(), which creates a new Error. A close sibling is Error.prototype.message, which the error message string. A close sibling is Error.prototype.name, which the name of the error type. A close sibling is Error.prototype.stack, which the stack trace. More about this category: Error types for exception handling. Related Error methods: Error(), Error.prototype.message, Error.prototype.name, Error.prototype.stack, TypeError(), RangeError(), ReferenceError(), SyntaxError(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try AggregateError() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.