Skip to content

Instantly share code, notes, and snippets.

@edubkendo
Created December 20, 2015 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edubkendo/ee1dc0b65d46736ff90d to your computer and use it in GitHub Desktop.
Save edubkendo/ee1dc0b65d46736ff90d to your computer and use it in GitHub Desktop.
function inputCheck (shitumon, outputNum) {
var condition = true;
var a = -1;
while(condition) {
console.log(a);
if (isNaN(a) || a <= -1) {
console.log("Invalid imput, please enter a number only!<br>");
a = 5;
} else {
condition = false;
outputNum = a;
}
}
return outputNum;
}
inputCheck("Please enter a number!", table);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment