Dragon Slayer - Understanding Concept-Question


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


while(slaying) {
    slaying = false;


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 .


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