In Javascript, is there a technique where I can execute code after a return?
- by Christopher Altman
Is there a technique where I can execute code after a return? I want to return a value then reset the value without introducing a temporary variable.
My current code is:
function(a){
var b;
if(b){
var temp = b; //I want to avoid this step
b = false;
return temp;
}else{
b = a;
return false;
};
};
I want to avoid the temp var. Is that possible?
var b holds a value between function calls because it is a memoization styled function.