var cost = function () {
if (x.value == "1") {
....
} else if (x.value == ""){
I want my program to stop the execution of any further code here if x.value = empty or null
}
};
I tried to return false here.
- New to programming
CodePudding user response:
var cost = function () {
if(!x) return;
// do rest of stuff that is necessary if x isn't null | empty
};
CodePudding user response:
To stop the execution of function simply return
if (x.value == "1") {
...
} else if (!x.value){
return;
}
};
CodePudding user response:
var cost = function () {
if (x.value == "") {
return;
}
...
};