4 ms·
This one is even more concise and avoids the scoping issues that forEach have: for (var i in cars) { console.log(cars[i]) } Also, if you're using JS on the fr
by workhere-io 12y ago
This one is even more concise and avoids the scoping issues that forEach have:
for (var i in cars) { console.log(cars[i]) }
Also, if you're using JS on the frontend, forEach isn't supported by all browsers: http://stackoverflow.com/questions/156696/which-web-browsers-natively-support-array-foreach http://stackoverflow.com/questions/156696/which-web-browsers...