Test
Just some tests
by Annemarie Köhler
HTML
<h1>Hallo</h1>
<div id="content1"></div>
<div id="content2"></div>
JavaScript
// -------------------------------------------------- //
function logArrayElements(element, index, array) {
$("#content1").html('a[' + index + '] = ' + element);
}
// Note elision, there is no member at 2 so it isn't visited
[2, 5, 7].forEach(logArrayElements);
// logs:
// a[0] = 2
// a[1] = 5
// a[3] = 9
// -------------------------------------------------- //
var a = ["a", "b", "c"];
a.forEach(function(entry) {
$("#content2").html(entry);
});