title: Filtering an Array in Javascript to Find 3 Consecutive Numbers
body: <p>Given an array of unsorted positive ints, write a function that finds runs of 3 consecutive numbers (ascending or descending) and returns the indices where such runs begin.  If no such runs are found, return null.</p>
  
  <pre><code>function findConsecutiveRuns(input:Array):Array
  </code></pre>
  
  <p>Example:  [1, 2, 3, 5, 10, 9, 8, 9, 10, 11, 7] would return [0, 4, 6, 7]</p>
  
  <p>My JS skills are a bit rusty, here is my attempt at this...</p>
  
  <pre><code>var numArray = [1, 2, 3, 5, 10, 9, 8, 9, 10, 11, 7];
  var newNumArray = []; 
  
  for(var i = 1; i &lt; numArray.length; i++) {
      if ((numArray[i] - numArray[i-1] != 1) || (numArray[i] + numArray[i+1] !=1)  {
          return 0;
      }
      else {
      newNumArray.push(numArray[i]);
      }
  }
  alert(newNumArray);
  </code></pre>