I am new to memory management in JS, so please pardon if this is a dumb question.
Suppose I have a component with three functions defined and a switch case statement which calls only one function depending on the case matched. Will the other two functions occupy the memory or they are garbage collected once the switch statement is executed?
function funcA() {};
function funcB() {};
function funcC() {};
switch(type) {
case 'funcA':
funcA();
break;
case 'funcB':
funcB();
break;
case 'funcC':
funcC();
break;
}