YouTip LogoYouTip

Jsref Obj Error

# JavaScript Error Object ## Error Object The Error object provides error information when an error occurs. ## Example In the following example, the try block contains an undefined function "adddlert". Executing it will produce an error, and the catch block will output the error information: ```javascript try{adddlert("Welcome"); }catch(err){document.getElementById("demo").innerHTML = err.name + "
" + err.message; } [Try it yourself Β»](#) For more information on JavaScript errors, see: [JavaScript Errors - throw, try and catch](#) * * * ## Error Object Properties | Property | Description | | --- | --- | | (#) | Sets or returns an error name | | (#) | Sets or returns an error message (a string) | * * * ## Non-standard Error Object Properties **Mozilla and Microsoft define the following non-standard Error object properties:** fileName (Mozilla) lineNumber (Mozilla) columnNumber (Mozilla) stack (Mozilla) description (Microsoft) number (Microsoft) It is not recommended to use these properties, as they are not supported by all browsers.
← Prop Error MessageMet Win Matchmedia β†’