JavaScript Array.isArray() Example

Home / JavaScript / JavaScript Array.isArray() Example


JavaScript Array.isArray()

method description

The Array.isArray() determines whether the passed value is an Array.

Show full syntax.

syntax

parameters

obj
The object to be checked.

return value

true if the object is an Array; otherwise, false.

examples

All following calls return true

All following calls return false

polyfill

Running the following code before any other code will create Array.isArray() if it’s not natively available.

JavaScript Array.isArray() by Mozilla Contributors is licensed under CC-BY-SA 2.5.



%d bloggers like this: