Użyj .Map do zliczania długości każdego elementu w tablicy
var lengths = chars.map(function(word){
return word.length
})
Wild Whale
var lengths = chars.map(function(word){
return word.length
})
var words = ['Hello', 'world'];
var lengths = words.map(function(word) {
return word + ' = ' + word.length;
});
console.log(lengths);