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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -