Browse - programming tips - javascript enumerate everything in an arrayDate: 2010jul19 Language: javaScript Level: beginner Q. How to I enumerate everything in a javaScript array? A. If it is NOT an associative array use a for-loop like this: var i, myelement; var a = [ 'apple', 'ibm', 'microsoft' ]; for (i = 0; i < a.length; i++) { myelement = a[i]; // Do something with myelement }
Add a commentSign in to add a comment |