Pre & Post Function
Most of the time this is a common mistake of myself when i code.
Pre Function
Pre function mean the function already fixed and unable to change later.
const scope = {
fn: () => console.log("OK")
};
const fn = scope.fn();
scope.fn = () => console.log("NOT OK");
fn();
// OK
Lazy / Post Function
Post function mean the function maybe will change anytime, changable after initialize. It also like a lazy function.
const scope = {
fn: () => console.log('OK')
}
const fn = () => scope.fn();
scope.fn = () => console.log("NOT OK");
fn();
// NOT OK