Skip to content

Latest commit

 

History

History
68 lines (57 loc) · 1.62 KB

File metadata and controls

68 lines (57 loc) · 1.62 KB
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
devlang-javascript
language-reference
JavaScript
TypeScript
DHTML
isArray function [JavaScript]
Array.isArray function [JavaScript]
58f7d2e0-d310-4292-b9bc-37a73c585780
8
mikejo5000
mikejo
ghogen

Array.isArray Function (JavaScript)

Determines whether an object is an array.

Syntax

Array.isArray(object)   

Parameters

object
Required. The object to test.

Return Value

true if object is an array; otherwise, false. If the object argument is not an object, false is returned.

Example

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  

Requirements

[!INCLUDEjsv9]

See Also

Array Object
Using Arrays
typeof Operator