The JavaScript code var a = new Array(); a[0] = 7; a[5] = "Dave"; document.writeln('Length of a[] is ' + a.length + ''); document.writeln('Display of array elements using traditional for loop:'); for (var i=0; i'); } document.writeln('Display of array elements using for/in loop:'); for (var ndx in a) { document.writeln('a[' + ndx + '] = ' + a[ndx] + + ''); }