JavaScript Array.isArray()
JavaScript Array.isArray()
The isArray() method is used to return true if an object is an array else false. It is a static property and we can only use it as Array.isArray().
Syntax:-
Its syntax is:- Array.isArray(obj)
Return:-
Its return is:- true if the object is array else false.
Further Explanation:-
Parameter | Description |
obj | Required. An object or any other data type to be tested. |