title: get rid of the for-in statement
body: <p>This is a function that creates breadcrumbs. It initially came from someone else, but I've tweaked it to work for my needs. Now--I'd like to fix the bad syntax of 'for(i in bits)', but when I've tried what I thought would work, it does not work. </p>
  
  <pre><code>for (i = 0; i &lt; bits; i++) {etc...};
  </code></pre>
  
  <p>I thought that would work, it does not work. Here is the full script...</p>
  
  <pre><code>function breadcrumbs() {
  'use strict';
  /*jslint plusplus:true*/
  /*jslint browser:true*/
  var sURL, bits, x, stop, output, i, y, chunkStart;
  sURL = String();
  bits = {};
  x = 0;
  stop = 0;
  output = "";
  sURL = location.href;
  sURL = sURL.slice(8, sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart + 1, sURL.length);
  while (!stop) {
      chunkStart = sURL.indexOf("/");
      if (chunkStart !== -1) {
          bits[x] = sURL.slice(0, chunkStart);
          sURL = sURL.slice(chunkStart + 1, sURL.length);
      } else {
          stop = 1;
      }
      x++;
  }
  for (i in bits) {
      output += "&lt;a href=\"";
      for (y = 1; y &lt; x - i; y++) {
          output += "../";
      }
      bits[i] = decodeURIComponent(bits[i]);
      output += bits[i] + "/\"&gt;" + bits[i] + "&lt;/a&gt; &amp;nbsp;|&amp;nbsp; ";
  }
  document.write(output + document.title);
  }
  </code></pre>