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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -