What in the living world is wrong with this


#1


I have been staring at this for an hour and a half now and can someone please tell me what in the living world is wrong with this before I throw my computer out the window?

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

soloLoop();

#2

Two too many semi-colons. Review your syntax.


#3

when you declare a variable the first time you have to put var before it otherwise it tries to find it from global scope and fails (in this case).

while(something);

by putting the semicolon right after the condition you are telling the js compiler to stop right there (that no statement follows).


#4

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