var coords={100: 100, 120: 120, 140: 140, 160:160, 180:180};
for (var key in coords) {
console.log(key + ' - ' + coords[key]);
}
I have variable coords
and for loop that prints out pairs of numbers like this:
100 - 100
120 - 120
140 - 140
160 - 160
180 - 160
I need setInterval
or something to console each pair of numbers every second.
I tryed to add setInterval, but in this case the code prints all the numbers every second, not individual pairs.