Tutorialsplane

ReactJs Get Array Length


We can use Array length method to get the length of array in reactjs. This method is also used to count the number of items in Array. Here in this tutorial, we are going to explain how you can get the length of array ie. count Array items using native JavaScript length method. You can also use our line editor to edit and run the code online.


ReactJs Get Array Length | Count Array Items Method Example

You can use the length method to count the number of items in an array-

Example:


Try it ยป

If you run the above example it will return 7 ie. total number of items in array. Output of above example will look something like this-

ReactJs Blog