| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Array.isArray Function (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
58f7d2e0-d310-4292-b9bc-37a73c585780 |
8 |
mikejo5000 |
mikejo |
ghogen |
Determines whether an object is an array.
Array.isArray(object)
object
Required. The object to test.
true if object is an array; otherwise, false. If the object argument is not an object, false is returned.
The following example illustrates the use of the Array.isArray function.
var ar = [];
var result = Array.isArray(ar);
// Output: true
var ar = new Array();
var result = Array.isArray(ar);
// Output: true
var ar = [1, 2, 3];
var result = Array.isArray(ar);
// Output: true
var result = Array.isArray("an array");
document.write(result);
// Output: false [!INCLUDEjsv9]