Such things just need to take and measure. In theory, the nested function should be slower, since it is created every time you call an external one.
In any case, it is highly unlikely that this will cause the script to work slowly.
function test(f) { var t = performance.now(); for (var q=0; q<1000000; ++q) { var x = new f(); } t = performance.now() - t; console.log((""+f).match(/function\s+(\w+)/)[1] + " " + t.toFixed(3) + " ms"); } function local() { function other(a) { ax = 90; } other(this); } var closure = (function () { function other(a) { ax = 90; } return function closure() { other(this); } })(); function field() { field.other(this); } field.other = function other(a) { ax = 90; }; test(local); test(closure); test(field);
PS: I have in Chrome a difference of 5-10 times against the nested function. But in fact, this is not the difference at times, but for a certain number of operations, so a comparison on empty or almost empty functions makes little sense.