title: Bootstrap carousel - loop in javascript
body: <p>I am trying to use the bootstrap carousel, but cannot really get it to work. I have a list with pictures I want to loop through and show in the carousel. I cannot show all the pictures since the "activate" (line 3 in the text below) only should be applied for the first picture (and not for the other ones in the list). This mean that I need some kind of restriction regarding the "activate". Probably something like "only use activate for the first loop-through". I'm not quite sure how to write that. I'm writing in javascript (newbie) and having a really hard time incorporating it in the html file. </p>
  
  <pre><code>  &lt;div class="carousel-inner"&gt;
          {% for image in images %}
            &lt;div class="carousel-item active"&gt;
              &lt;img src="{{ url_for('static', filename='images/' + image.image) }}" alt="{{ name }} product image" class="d-block w-100"&gt;
            &lt;/div&gt;
          {% endfor %}
      &lt;/div&gt;
  </code></pre>