Suppose the variable is not.
Code:
if(object . prototype . tostring . call(a)= '[object String]'){
//a is a character type.
}
The above code can determine whether A is a string type or a string object.
If (object.prototype.tostring.call (a) =' [object number]') {
//a is a numeric type.
}
The above code can determine whether A is a numeric type or a numeric object.