javascript count total array code example
Example: use .map to count length of each element in an array
var lengths = chars.map(function(word){
return word.length
})
var lengths = chars.map(function(word){
return word.length
})