toString()
Error
instance method getterS2C Home
« Globals « Error « toString()
Description
Returns a string composed of concatenated error elements delimited by commas.
This method overrides the toString()
method of Object
.
Syntax
Signature | Description |
---|---|
anError.toString() | Returns a string composed of concatenated error elements delimited by commas. |
Parameters
None.
Examples
Let's look at an example of using to toString()
method.
// Create our own error object.
var anError = new Error();
alert(anError.toString());
var anotherError = new Error('My Message');
alert(anotherError.toString());
Related Tutorials
JavaScript Advanced Tutorials - Lesson 2 - Errors