Dragon Slayer - Understanding Concept-Question


#1


Just out of curiosity and future coding endeavors. I understand that in this exercise we set "var slaying = True;" When one creates a while loop like the I one I posted, by just entering the variable I created and making it equal false. The entire variable I created in the first place gets ignored? In what instances do we want to contradict our own variables? etc

https://www.codecademy.com/en/courses/javascript-beginner-en-mrTNH-6VIZ9/0/3?curriculum_id=506324b3a7dffd00020bf661#


while(slaying) {
    slaying = false;
}


#2

simply answer yes :slight_smile:

while(condition) {
    slaying = false;
}

Here the while loop will run, over and over again, as long as the condition is true. if you not set slaying = false while loop will not stop .It will crash your browser.To stop while loop you have to false the condition and its very important .


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.