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

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -