javascript - How to optimize JS code? -
chrome profiling say: "not optimized: assignment parameter in arguments object". can optimize code?
this.buffer.foreach(function(tilepos, ypos) { tilepos.foreach(function(tileinfo, xpos) { _self.tiles.puttile('ground', xpos, ypos, _self.ground); }); });
it not acting on tilepos
within block.
i recommend doing follows if wish eliminate error, bit of performance boost:
for(var = 0; < this.buffer.length; i++) { for(var j = 0; j < this.buffer[i].length; j++) { _self.tiles.puttile('ground', i, j, _self.ground); } }
Comments
Post a Comment