html - functions of javascript "return" -


in javascript, can return used "kill" variable speak (as in, stop functioning past point throughout code)? working on piece of code , want variable "msg" stop working if value empty avoid alert box popping up. correct, or alert still pop up?

if(msg==””){ return result;  }  { alert(msg) return result; } 

return used allow functions hand control, can not used outside of function. think looking else

if(msg==""){  // } else {   alert(msg); } 

if want "kill" variable, can delete variable_name make undefined


Comments

Popular posts from this blog

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -