I want to get the user input and search for it through the array of objects . I use for in to iterate through the array of object and if loop for comparing .If the if condition is true the current object details needs to be displayed to the user and if not found show an error message.My code works fine if only the If condition is provided but if the else condition is provided only the else block is executed always.
My html :
<input type="text" id="name" placeholder="Name"><br>
<input type="button" value="Get Pokemon Details" id="pokedetails">
My javascript code so long for the viewing purpose i have included in jsfiddle please visit there for the script file. Click Here to Visit JsFiddle
what was the problem with my code or any solution for this?
Aucun commentaire:
Enregistrer un commentaire