I am trying to create a game, and I noticed that for an organization it is better to place some functions inside other functions, because they are used exclusively in the original function. For instance:
function fn1() { fn2(); function fn2() {
fn1 is called many times, and fn1 will call fn2 several times in its execution. When fn1 is fn1 , does fn2 need to fn2 processed (due to the lack of a better word) every time? Because of this, am I losing in terms of performance? Should I place fn2 after fn1 instead, like this?
function fn1() { fn2(); } function fn2() {
source share