typescript foreach this code example
Example 1: javascript foreach
var colors = ['red', 'blue', 'green'];
colors.forEach(function(color) {
console.log(color);
});
Example 2: perform a function on each element of array javascript
var new_array = old_array.map(function(e) {
e.data = e.data.split(',');
return e;
});