Skip to content
Advertisements

Array.isArray()

Array.isArray() function determines whether the value passed to this function is an array or not. This function returns true if the argument passed is array else it returns false.

Array.isArray(obj)

obj : Required. The object to be tested.


Examples:

        Array.isArray() // false
        Array.isArray([]); // true
        Array.isArray('List'); // true
        Array.isArray(new Array()); // true
        Array.isArray(null); // false
        Array.isArray(true); //false
        Array.isArray([1]); // true
        Array.isArray({}); // false
        Array.isArray(undefined); // false
        Array.isArray(25); // false
Advertisements

2 Comments »

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: