Array.isArray

Determines whether the given argument is an Array.

Syntax

isArray(arg)

Parameters

Return value

Returns true if the argument is an Array, false otherwise.

Examples

Array.isArray([1, 2])
true
Array.isArray("ceci n'est pas une array")
false
Array.isArray({1: 2, 3: 4})
false
Array.isArray(new Uint8Array(1))
false
var a = [1, 2]
var b = {"one": 1, "two": 2}
print(typeof a)
print(Array.isArray(a))
print(typeof b)
print(Array.isArray(b))
object
true
object
false