I don\'t get how hard it is to discern a string containing a number from other strings in JavaScript.
Number(\'\') evaluates to 0, while
No need to panic just use this snippet if name String Contains only numbers or text. try below.
var pattern = /^([^0-9]*)$/;
if(!YourNiceVariable.value.match(pattern)) {//it happen while Name Contains only Charectors.}
if(YourNiceVariable.value.match(pattern)) {//it happen while Name Contains only Numbers.}