DEV Community


Discussion on: Pokemon API and React

omkar76 profile image

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.

  1. 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!");
  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.

This is what I did in my code coach project on sololearn

omkar76 profile image
  1. Hard to say anything without reading you code ☺
ivanradunkovic profile image
Ivan Radunković Author

Hi Omakar76, many thanks for your help.

This is my git repo with this issues