You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • Well not sure about this, isn't x=0 faster than `i++, but let's compare the empty loops.

    function forLoopV2(){
          for (i = 0; i < LOOPS; i++) {}
    function whileLoopV2(){
          var i = LOOPS;
          while (i--) {}

    Any way it is clear that while loops are faster than for loops.


Avatar for MaBe @MaBe started