Class: Object

Object

The JavaScript Object class.

new Object()

Source:
See:

Methods

<static> each(object, callback(value,key,object)) → {Object}

A generic iterator function for iterating over objects via their named properties. Iteration can be cancelled by returning false in the callback.

Parameters:
Name Type Description
object Object

An object to iterate over.

callback(value,key,object) function

A function to be executed on each item.

Source:
Returns:
Type
Object

The input object.

<static> getClassOf(obj) → {String}

Gets an object's JavaScript [[class]].
Parameters:
Name Type Description
obj *

Any object/value.

Note: For certain objects, the [[class]] name may be inconsistent between browsers (mainly just the window and document objects). The only objects that are guaranteed to produce consistent results are those that are defined in the ECMAScript specification, but modern browsers are consistent enough that this function will produce consistent output for most inputs.

Source:
Returns:
Type
String

The passed in object's [[class]] name.

Example
Object.getClassOf([]);       // -> "Array"
Object.getClassOf({});       // -> "Object"
Object.getClassOf('string'); // -> "String"
Object.getClassOf(/^.+reg/); // -> "RegExp"
Object.getClassOf(window);   // -> "Window" or "global"
Object.getClassOf(document.body.childNodes); // -> "NodeList"