0

how to calculate array length

if i have array like this ["php""js""Sql"] how to calculate lengeth

13th Sep 2016, 1:20 PM
mhennaoui
mhennaoui - avatar
2 Answers
+ 3
var arr = ["php", "js", "sql"]; document.write(arr.length);
13th Sep 2016, 2:08 PM
Zen
Zen - avatar
0
As Zen mentioned, the "length" method is the best way. Here's more about it from MDN - https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/length
13th Sep 2016, 3:36 PM
Yoni Lavi
Yoni Lavi - avatar