Solo Flight


var zift = true;
var soloLoop = function(){
  //Your code goes here!
  while(zift = true) {
    console.log("Looped once!");
    zift = false;


//Why does my code keep crashing the browser???? I closed the loop :frowning:


Got it. removed "=true"


Yes = assigns where you seek to compare (== or ===). Also an assignment has the value you assign which is in this case true, which can become a program as you experienced.

As a condition searches for a value of true or false you could as well use the variable (here: zift) as well as it contains a boolean value already. But in case zift is not a boolean it would be better to use == or === for comparison.


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