Sample code to generate and access a collection is:
<script type="text/javascript">
function generate(){
var arr = new Array();
<c:forEach items="${articles}" var="a" varStatus="status">
$('#listitems').append(
"<li>"+${a.title}+"</li>"
);
arr[${status.index}] ="${a.slideShow.images}";
</c:forEach>
}
function generate(){
var arr = new Array();
<c:forEach items="${articles}" var="a" varStatus="status">
alert(arr[${status.index}]);
</c:forEach>
</script>