var input = document.getElementById("input").value;
function sendRequest {
if (Validate.isNumber(input)) {
input.focus();
return;
}
// or
if (Validate.isNumber(input)) {
input.focus();
return null;
}
// or
if (Validate.isNumber(input)) {
return input.focus();
}
// start Ajax call
var xhttp = new XMLHttpRequest();
...
}
Above 3 function have same result (if validation fail ends the function execution)... So what is the difference? Which one is better?