JavaScript: How to skip over current item in array during a for loop? (continue?)
<p>EDIT: I don't want to skip index 1. I want to skip the current (clicked on) element. Also, see below for more of the code as requested. You'll see that I have a class <code>CatListItem</code> and five instances of that class in an array <code>allCatListItems</code>.</p>

<p>Here's some context for the question: I have a list of cats. When I click on a cat's name (list item), I want that cat's picture and other info to be appended to the page (got that down). When a cat is clicked, I also want any other cat that is being displayed to be hidden (that way there is only one cat on the screen at a time).</p>

<p>I'm trying to accomplish this with a <code>for</code> loop, but obviously if it iterates over every item in the array, then when I click an item, the cat being clicked will be hidden as well.</p>

<p>I want to skip the current item in the array and only run the code on the other items. Using continue, I know I can skip a specific item (item <a href="https://jsfiddle.net/2r7asf3e/" rel="nofollow">1</a> in the below example). This will run my code on every item in the array except that at index one. But how can I make that <code>continue</code> dynamic? Meaning... how can I hide all of the cats, except the one being currently clicked? </p>

<p>Here's the loop that skips index 1:</p>

<pre><code>CatListItem.prototype.hideCats = function() {
    allCatListItems.forEach(function(cat) {
        cat.a.addEventListener('click', function() {
            for (var i = 0; i &lt; allCatListItems.length; i++) {
                if (i === 1) {
                    continue;
                }
                allCatListItems[i].img.className = 'hide';
            };
        });
    });
}

var allCatListItems = [
    catListItem1 = new CatListItem('El', 'images/el.jpg', 'el'),
    catListItem2 = new CatListItem('Widdle Baby', 'images/widdle-baby.jpg',     'widdle-baby'),
    catListItem3 = new CatListItem('Mama', 'images/mama.jpg', 'mama'),
    catListItem4 = new CatListItem('Legion', 'images/legion.jpg', 'legion'),
    catListItem5 = new CatListItem('Boy', 'images/boy.jpg', 'boy'),
];
</code></pre>

<p>EDIT: Here's a fiddle.<a href="https://jsfiddle.net/2r7asf3e/" rel="nofollow">JSFIDDLE</a> Click the names to see the functionality without the hideCats function. Then uncomment where it says to to see my issue.</p>

<p>I'm starting to think maybe a for loop isn't the best option?</p>