yakra / tmtools

Tools to aid in development of the TravelMapping project
0 stars 0 forks source link

canvas/tmg2html: javascript for loops #71

Closed yakra closed 6 years ago

yakra commented 6 years ago

for (i = 0 ; i < MyArray.length; i++) DoStuff() -> for (var foobars in MyArray) DoStuff() as appropriate

yakra commented 6 years ago

Nope. That would be forEach, in the case of arrays. The forEach() method calls a provided function once for each element in an array, in order; it's not worth the complication of writing new functions to change this, where it can be done. Will keep this in mind when tackling tile rendering, though.