JavaScript: Get Array Length
Question by PC Control | 2014-05-22 at 11:12
Currently, I am trying to determine the length of an array in JavaScript.
Unfortunately, neither length(arr) nor count(arr) are working for me.
Can someone help me how to get the number of elements in a JavaScript array?
Related Topics
JavaScript: Create and Use Arrays
Info | 0 Comments
PHP: Remove all empty elements from string array
Tip | 0 Comments
Lazarus: Load File as Byte Array and save Byte Array as File
Tutorial | 0 Comments
jQuery: Does an Element exist?
Tip | 1 Comment
Send Form Input as an Array to PHP Script
Tip | 0 Comments
PHP: Write array to individual Variables
Tutorial | 0 Comments
JavaScript: Sort Array of Numbers
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
In JavaScript, every array has the property "length" with which you can determine the length:
Or for two-dimensional arrays:
With count(arr), you can get the array length in PHP.
2014-05-22 at 16:32