Error.message not listed as a property in MDN documentation?
I generally have trouble reading javascript documentation. A lot of times,
they don't list methods (because they are non-standard) and I don't
understand the language itself.
For the Error object, I saw it used in the following context:
var div = function(a, b){
try{
if(b===0){
throw new Error("Divided by Zero");
}else{
return a/b;
}
}catch(e){
log('name\n%s\n\nmessage\n%s,\n\nstack\n$s', e.name, e.message,
e.stack);
}
};
log(div(5, 0));
e.stack is a non-standard, but when I look for e.message, I cannot find it
under "properties."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Properties
Why isn't message a property of Error? Do I have the definition of
'property' wrong? Or did MDN mess up?
No comments:
Post a Comment