title: For else loop in Javascript?
body: <p>Is there a Javascript equivalent of the python 'for-else' loop, so something like this:</p>
  
  <pre><code>searched = input("Input: ");
  for i in range(5):
      if i==searched:
          print("Search key found: ",i)
          break
  else:
      print("Search key not found")
  </code></pre>
  
  <p>Or do I just have to resort to a flag variable, so something like this:</p>
  
  <pre><code>var search = function(num){
      found = false;
      for(var i in [0,1,2,3,4]){
          if(i===num){
              console.log("Match found: "+ i);
              found = true;
          }
      }
      if(!found){
          console.log("No match found!");
      }
  };
  </code></pre>