Function()

Garrett Smith dhtmlkitchen at gmail.com
Fri Sep 5 23:05:03 PDT 2008


I have a question about the Function constructor algorithm:

1. Let P be the empty string.
2. If no arguments were given, let body be the empty string and go to step 13.

Would it be OK to just use:-

2. If no arguments were given, return a function as specified in 13.2.

The resulting function would be indistinguishable. The performance
would be potentially faster (no parsing "" to create a Function).
Firefox is very slow with Function constructor.

var slow = Function();
var fast = function(){};


More information about the Es-discuss mailing list