Wednesday, July 1, 2015

Javascript Arrays

One more post on covering the basics before we get to the canvas.

Arrays in Javascript are similar to other programming language arrays.

This is a dynamic array. Can be created and filled at anytime. Here is the output.

This is a static array, it is created as the HTML5 page is created. Has the same output.
Arrays can be altered after they have been created, all arrays are essentially dynamic. 
***To be safe make sure you never try to access an array beyond it's bounds. I use index%arraylength***




No comments:

Post a Comment