According to the spec, it is; whether an engine optimizes it depends on the engine. (I expect most will.) I am intrigued to see that your test case and mine have such varying results: jsperf.com/cost-of-creating-inner-function Not that I think performance is an issue, though.