toSource

Non-standard

Summary

Returns a string representing the source code of the array.

Method of Array
Implemented in JavaScript 1.3
ECMAScript Edition none

Syntax

array.toSource()

Parameters

None.

Description

The toSource method returns the following values:

  • For the built-in Array object, toSource returns the following string indicating that the source code is not available:
function Array() {
    [native code]
}
  • For instances of Array, toSource returns a string representing the source code.

This method is usually called internally by JavaScript and not explicitly in code. You can call toSource while debugging to examine the contents of an array.

Examples

Example: Examining the source code of an array

To examine the source code of an array:

alpha = new Array("a", "b", "c");
alpha.toSource()                    //returns ["a", "b", "c"]

See Also

toString

Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file