Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array comprehension javascript

[for (i of [ 1, 2, 3 ]) i*i ]; 
// [ 1, 4, 9 ]

var abc = [ "A", "B", "C" ];
[for (letters of abc) letters.toLowerCase()];
// [ "a", "b", "c" ]
Source by www-lia.deis.unibo.it #
 
PREVIOUS NEXT
Tagged: #array #comprehension #javascript
ADD COMMENT
Topic
Name
1+3 =