I am writing a Javascript function to validate a user input. The condition is that, the data should have at least one number.
var userName = "abcde200"
function isNumeric(userName){
userName = parseInt(userName);
userName = !isNaN(userName);
return userName;
}
The function returns "true" when the value starts with number like: "200abcde" but doesn't return "true" value with if the numbers are between alpha or at the end. I know, this could be done easily with regular expression but I want to achieve this without regular expression.
Note: There are plenty of similar questions here but didn't work any of them to solve my case.