The Error object provides error information when an error occurs.
try { adddlert("Welcome guest!"); } catch(err) {/*w w w . j ava 2 s .co m*/ console.log(err.name + "\n" + err.message); }
Property | Description |
---|---|
name | Sets or returns an error name |
message | Sets or returns an error message (a string) |