Angularjs Examples

AJS Examples


AngularJS IsArray Function

AngularJS isArray function is used to identify if a reference is array or not. This function return true if reference is array.

Syntax

angular.isArray(value);

AngularJS IsArray Function Example

<!DOCTYPE html>
<html ng-app="">  
<head>  <!-- www.techstrikers.com -->
<title>My first AngularJS code</title>  
<script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">  
</script>  
  
</head>  
<body bgcolor="#bnde45">
<fieldset>
<legend>AngularJS IsArray Function</legend>
<script>  

var sourceAry = [1,2,3,4,5,6];
var str = "www.techstrikers.com";

document.write(angular.isArray(sourceAry));  
document.write("</br>");
document.write(angular.isArray(str)); 
  
</script>
</fieldset>
</body>  
</html>
See Live Example