JavaScript · Error types

error.stack

A non-standard but widely supported stack trace string. Log it, but do not parse it in production.

Syntax
error.stack

Example

Try it

More in this group

AggregateError new Error() RangeError SyntaxError TypeError

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course