can't print array of objects with forEach node js code example
Example 1: js loop through associative array
var months = [];
months["jan"] = "January";
months["feb"] = "February";
months["mar"] = "march";
for (var key in months) {
var value = months[key];
console.log(key, value);
}
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;
});