Can you guys help me determine the performance difference of each of these statements? Which one would you use?
Making a new Array using
- var new_list = new Array(); //or - var new_list = [];
Appending element using
- push('a') - new_list[i]; (if i know the length)
Ternary operator or
if() {} else (){}
Trying to make isodd function, which is faster
(! (is_even)) or (x%2!=0)
forEach()
or normal iteration
one more
a= b = 3;
orb=3; a=b;
[edit: I'm making a Math Library. So any performance hacks discussions are also welcome :) ]
Thanks for your help.