Skip navigation

Built-in toSource methods

Each core JavaScript type has its own toSource method. These objects are:

  • toSource – Array Object method.
  • toSource – Boolean Object method.
  • toSource – Date Object method.
  • toSource – Function Object method.
  • toSource – Number Object method.
  • toSource – Object Object method.
  • toSource – RegExp Object method.
  • toSource – String Object method.

Of course it is ideal to use something like Firebug’s console or a similar tool when available, but sometimes in some places that’s not available such as Firefox Extension development. Using toSource on an array or object literal or even a custom object is better than using your own for loop which is what I have done in the past!

Posted via web from Apphacker’s learning curve

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: