[Solved] Does object literal notation containing functions execute faster than (global scope) plain functions (dereferencing)?


As T.J. Crowder states in his comment to the question “JavaScript Object Literal notation vs plain functions and performance implications?”:

Perf questions in JS are tricky, because the engines vary so much. But
if you mean the two options in the question, the answer is almost
certainly no. Once the engine has the function reference, doing the
call will be the same in both cases, so we have to look at how the
engine gets the function reference.

In the first example, to call foo the engine has to look up foo on the
binding object of the execution context. In the second example, it has
to look up Baz the same way, then look up foo on Baz, which is more
steps. But I bet it doesn’t make a real difference.

solved Does object literal notation containing functions execute faster than (global scope) plain functions (dereferencing)?