A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Error/message below:

message ยท WebPlatform Docs

message Summary

Returns an error message string.

Syntax
errorObj.message
errorObj
Required. Instance of Error object.
Examples

The following example causes a TypeError exception to be thrown and displays the name of the error and its message.

try
 {
     
     var x = y;
 }
 catch(e)
 {
     document.write ("Error Message: " + e.message);
     document.write ("<br />");
     document.write ("Error Code: ");
     document.write (e.number & 0xFFFF)
     document.write ("<br />");
     document.write ("Error Name: " + e.name);
 }

The output of this code is as follows.

Error Message: 'y' is undefined
 Error Code: 5009
 Error Name: TypeError
Remarks

The message property returns a string that contains an error message associated with a specific error.

The description and message properties provide the same functionality. The description property provides backwards compatibility; the message property complies with the ECMA standard.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4