angular-isArray

 

angular.isArray is used to check whether the object is an array or not? and the return value is Boolean true otherwise return false. See the code snippet:

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome in the AngularJS</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="app"> <div ng-controller="isArrayController"> isArray: {{isArray}} </div> </body> </html> <script> var app = angular.module("app", []); app.controller('isArrayController', ['$scope', function ($scope) { var values = [{ name: 'Jimmi', gender: 'male' }, { name: 'Marry', gender: 'female' }, { name: 'Bob', gender: 'male' }]; $scope.isArray = angular.isArray(values) }]); </script>
Output