Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

use .map to count length of each element in an array

var words = ['Hello', 'world'];

var lengths = words.map(function(word) {
  return word + ' = ' + word.length;
});

console.log(lengths);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #length #element #array
ADD COMMENT
Topic
Name
3+8 =