Second question is VERY interesting. Only benchmarks can say the truth.
[http://jsperf.com/function-vs-function/][1]
[http://jsperf.com/function-vs-function/1..8][2]
[http://jsperf.com/function-vs-constructor-vs-eval][3]
[http://jsperf.com/function-vs-constructor-vs-eval/1][4]..5
It looks they are almost equal? I can see in modern browsers each variant is optimized enough
BUT BE AWARE OF RECREATING THE FUNCTION IN A LOOP!
[http://jsperf.com/function-vs-function/2][5]
Any wise comments? [1]: http://jsperf.com/function-vs-function/ [2]:
http://jsperf.com/function-vs-function/61..8 [3]:
http://jsperf.com/function-vs-constructor-vs-eval [4]:
http://jsperf.com/function-vs-constructor-vs-eval/31 [5]: ..5
It looks they are almost equal? I can see in modern browsers each variant is optimized enough
BUT BE AWARE OF RECREATING THE FUNCTION IN A LOOP!
http://jsperf.com/function-vs-function/2
Any wise comments?
Second question is VERY interesting. Only benchmarks can say the truth.
[http://jsperf.com/function-vs-function/][1]
[http://jsperf.com/function-vs-function/1..8][2]
[http://jsperf.com/function-vs-constructor-vs-eval][3]
[http://jsperf.com/function-vs-constructor-vs-eval/1][4]..5
It looks they are almost equal? I can see in modern browsers each variant is optimized enough
BUT BE AWARE OF RECREATING THE FUNCTION IN A LOOP!
[http://jsperf.com/function-vs-function/2][5]
Any wise comments? [1]: http://jsperf.com/function-vs-function/ [2]: http://jsperf.com/function-vs-function/6 [3]: http://jsperf.com/function-vs-constructor-vs-eval [4]: http://jsperf.com/function-vs-constructor-vs-eval/3 [5]: http://jsperf.com/function-vs-function/2
Second question is VERY interesting. Only benchmarks can say the truth.
http://jsperf.com/function-vs-function/
http://jsperf.com/function-vs-function/1..8
http://jsperf.com/function-vs-constructor-vs-eval
http://jsperf.com/function-vs-constructor-vs-eval/1 ..5
It looks they are almost equal? I can see in modern browsers each variant is optimized enough
BUT BE AWARE OF RECREATING THE FUNCTION IN A LOOP!
http://jsperf.com/function-vs-function/2
Any wise comments?
Second question is VERY interesting. Only benchmarks can say the truth.
[http://jsperf.com/function-vs-function/][1]
[http://jsperf.com/function-vs-function/1..8][2]
[http://jsperf.com/function-vs-constructor-vs-eval][3]
[http://jsperf.com/function-vs-constructor-vs-eval/1][4]..5
It looks they are almost equal? I can see in modern browsers each variant is optimized enough
BUT BE AWARE OF RECREATING THE FUNCTION IN A LOOP!
[http://jsperf.com/function-vs-function/2][5]
Any wise comments? [1]: http://jsperf.com/function-vs-function/ [2]: http://jsperf.com/function-vs-function/6 [3]: http://jsperf.com/function-vs-constructor-vs-eval [4]: http://jsperf.com/function-vs-constructor-vs-eval/3 [5]: http://jsperf.com/function-vs-function/2