title: Jquery counter in a for loop
body: <p>I am trying to make a counter in jquery something like this...</p>
  
  <pre><code>for(counter = 1;counter&lt;4;counter++){
  }
  </code></pre>
  
  <p>would this work?</p>
  
  <p>Well I am just saying the loop as a test...what I am ultimately trying to do is remove duplicate images from this code...</p>
  
  <pre><code>            // Preloads images within a rel group
              if (settings.preloading) {
                  preload = [
                      getIndex(-1),
                      getIndex(1)
                  ];
                  while (i = $related[preload.pop()]) {
                      src = $.data(i, colorbox).href || i.href;
                      if ($.isFunction(src)) {
                          src = src.call(i);
                      }
                      if (isImage(src)) {
                          img = new Image();
                          img.src = src;
                      }
  
                  }
  </code></pre>