function A() {
function B() {
...
}
B();
}
Is function B
created every time A
is called or is there some caching on it. Is not making it local like :
function A() {
B();
}
function B() {
...
}
A significant performance improvement?
Is it valid to do this a style choice? (B
in this case is just a helper function for A
.) or should the second be favoured for speed?
Should this style be used or avoided for readability?
Seems like FF4 inlines B
for the local case and removes the function call overhead.
What about other browsers?