performance - Whats the fastest in javascript? -


I was wondering which of the following is faster:

Calculate when calling a function :

isOnAir: function () {return (this.velocity.y! = 0)}

At the update function:

  // When the input happens it is Vivacity.i = CONST_SPEED; This.isOnAir = True;  

I am using many things like before. I started watching such works while programming on Ruby and it seems that the code is cleaner for me

thanks for the help / info :)

The speed of your tests can vary depending on the JavaScript engine you are using (browser).


Comments