javascript print array using while loop

javascript print array using while loop
<script type="text/javascript"><!--
var array = [ 'zero', 'one', 'two', 'three' ];
document.write('<ol>');
while ( array.length > 0 ) {
  document.write('<li>' + array.shift() + '</li>');
}
document.write('</ol>'); //-->
</script>
Should look like–
[close] Permanent link · http://querylog.com/q/javascript+print+array+using+while+loop

Suggested HTML for linking:
Link preview: javascript print array using while loop
04 November 2005 · Internet & computing
The page found by the original query:
Randomize arrays in JavaScript with the Fi…
Browse by the page—15 Q&R each
« previous | more »