nzisaacnz

The loop that deserves respect

Jul 29th, 2013
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try//!2
  2. {
  3.  (function(arr)
  4.  {
  5.   console.log("Counting UP");
  6.   function _(a)
  7.   {
  8.    a=a|0;
  9.    if(a<arr.length)
  10.    {
  11.     try
  12.     {
  13.      console.log("arr["+a+"]="+arr[a]);
  14.      _(a+1);
  15.     }
  16.     catch(i)
  17.     {
  18.      i--;
  19.      console.log("arr["+i+"]="+arr[+i]);
  20.      throw +i;
  21.     }
  22.    }
  23.    else
  24.    {
  25.     console.log("And counting DOWN");
  26.     throw a;
  27.    }
  28.   }_();
  29.  })([1,3,5,7,"Please don't ask what's wrong with me"]);
  30. }
  31. catch(aCold)
  32. {
  33.  //because it is winter
  34. }
Advertisement
Add Comment
Please, Sign In to add comment