It is working well.
- Is it bad if the functions are not returned to the calling function and finally to the operating system.
- I will there be a over flow of stack or will stack keep increasing if i am throwing many such errors.
Here is an example...
<input type='text' name='name' id='name' />
isempty('name','Please enter your name');
// no if condition or return statement here
var so = document.getElementById(src)
throw new Error('Stopi')
so i dont have to use if condition when validating. no braces, no return statement, and no need to call focus for every if condition so this code reduces 6 lines and multiplied by number of input controls you are going validate. so i just need to call isempty and if the control has empty value then the user will get an alert and the execution stops.