:: StoryTitle Looping in Snowman :: Start <% // An array of the strings "Bread", "Pan", "Book" s.arrayInventory = ["Bread", "Pan", "Book"]; // An example using JavaScript for (var i = 0; i < s.arrayInventory.length; i++){ %>You have <%= s.arrayInventory[i] %>.
<% } %>
<% // An example using Underscore.js _.each(s.arrayInventory, function(item) { %>You have <%= item %>.
<% }); %>
<% // An example using jQuery jQuery.each(s.arrayInventory, function( index, value ) { %>You have <%= value %>.
<% }); %>