Im reading this article: http://docs.nodejitsu.com/articles/errors/what-is-the-error-object
and trying to analyse the Error
object with this code.
var error = new Error("The error message");
console.log(error);
When i run this code in Node I dont get the output expected. According to NodeJitsu the output should be a javascript object with methods and properties, like this:
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'The error message' }
Instead i get this strange output:
[Error: The error message]
Why is this? Why square brackets, as this indicate that the Error
is an Array.
And where are the rest of the expected methods and properties?