Something unknown is doing we don't know what.” Sir Arthur Eddington
A resource for web developers a code snippet library with step by step tutorials.

a resource for web developers...

       

Search Amazon

JavaScript: Arrays tutorial code snippet 5a.

 

Up Up to JavaScript: Arrays overview page

 

 

Experimenting with the array size (length): dynamic arrays.

Create an array of a predefined size and assign values to index values larger than the array size: this results in extending the array size to accommodate the values.

Create an array without first defining the size and assign a value to a random index value: this results in leaving the first part of the array 'empty' or 'undefined'. Using a 'for loop' to iterate through an array structure and write to the page in each case.

 





Output view



Back to top

 

Bookmark and Share

 

Copyright © 2006-2010 justfigures.co.uk