If i want write an if statement where on the web page a prompt for your username pops up and i want it to be a string only how do i do this. For example if you type in a string it would say "username accepted" but if you type in a number it would say "username denied". The code I have so far says Username Accepted everytime.
let webUser = prompt("Please create a username", "typehere");
if (webUser != null) {
document.getElementById("root").innerHTML =
"Hello " + webUser + "! How are you today?";
}
if (typeof webUser == 'string' || webUser instanceof String) {
alert('Username Accepted')
} else {
alert('Username Denied')
}