angular-isArray-1

 

In this example of angular.isArray, it will return false because we are testing with an object not with array

 
 
 
<!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: 'Jimi', gender: 'male' }; $scope.isArray = angular.isArray(values) }]); </script>
Output