AngularJS – angular.isArray() Function

The angular.isArray() function in AngularJS basically checks if a reference is an Array or not. This method will return True if the reference passed inside the function is an Array type, else it will return False.

Syntax

angular.isArray(value)

Example − Check if the reference is an Array or not

Create a file "isArray.html" in your Angular project directory and copy-paste the following code snippet.


   
      angular.isArray()
      
   
   
      

         Welcome to Tutorials Point      

     

AngularJS | angular.isArray()

     
         Value: {{value}}          

         {{isArray}}          

         Value: {{value2}}          

         {{isArray1}}          

         Value: {{value3}}          

         {{isArray2}}          

         Value: {{value4}}          

         {{isArray3}}      
           

Output

To run the above code, just go to your file and run it as a normal HTML file. You will see the following output on the browser window.

Updated on: 2021-10-06T07:06:57+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements