Jump to content


Photo

Need some help with a while loop in JavaScript

Need some help

  • Faça o login para participar
Nenhuma resposta neste tópico

#1 davidcave

davidcave

    Normal

  • Usuários
  • 101 posts
  • Sexo:Masculino
  • Localidade:David

Posted 08/09/2017, 09:47

Hello,
I am fairly new to JavaScript, I am going through Coding with JavaScript for dummies and the book is filled with coding errors. As I am a neewbie some of them are difficult to correct my self. So I hope someone can help me with this while loop : I have googled this for a couple of hours and tried to tweak it several times. As is, it does not seem to be a way out of the while loop, it does not register the word "banana" as a true and exit the loop. 
I have made it recognize the word banana a couple of times with some tweaks but it will either just prompt the first statement and alert the second no matter what word is typed. or it will understand the word banana but fall in to the while loop again after clicking the ok sign for the correct answer ( I would like the loop to be done after the word banana )
 
As I am trying to understand the while loop I would love to understand what is wrong whit this string example, as most of the examples are counting examples ( alot easier for me to understand with a MATLAB background ) 
 
Hope someone can help me  ( English is not my first language, so sorry if this was difficult to understand 
Thank You
 
 
I didn't find the right solution from the Internet.
 

 






0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq