I'm not a JS expert.
I haven't touched react 😬.
I still love JS.
This is my first comment.
well, let me try.
So you want case insensitive comparison of strings.
let pokemon = "pikachu";
let guess = prompt("What do you think it's? ");
if(guess.trim().toLowerCase() ===pokemon) {
alert("That was correct!");
}else{
alert("You need to do more research");
}
first trim the string. Trim method removes leading and trailing white spaces from string.
convert user input to lowercase and then do comparison.
Before I try to answer let me introduce myself.
I'm not a JS expert.
I haven't touched react 😬.
I still love JS.
This is my first comment.
well, let me try.
first trim the string. Trim method removes leading and trailing white spaces from string.
convert user input to lowercase and then do comparison.
This is what I did in my code coach project on sololearn
Hi Omakar76, many thanks for your help.
This is my git repo with this issues
github.com/ivanradunkovic/Pokemon