File tree Expand file tree Collapse file tree
Data_Structures/Arrays/Iterators Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11![ ] ( http://i.imgur.com/BgUMUGU.png )
22
33# Iterators
4- This MD file serves as example/template. It will be filled up soon.
5-
6- (for Bucky to fill up)
4+ ** Simple Iteration**
5+ The way to iterate elements in javascript arrays is pretty straight forward:
76
8- # Course Documentation
7+ console.log(food[2]);
98
10- (this for me to fill up with every element that you use in lessons. syntax explaination and links for more)
9+ Array values are retrieved by index (starting at 0 not 1).
10+
11+ ** Iteration through loop**
12+ The best way to iterate an array is mathematically through a loop, like the example bellow:
1113
12- ## Element to explain
14+ // you can iterate over an array to access each individual element
15+ for(var i=0; i<food.length; i++){
16+ console.log(i, food[i]);
17+ }
18+
19+
1320
14- (for example console.log)
21+ # Course Documentation
1522
1623##Javascript functions
1724
You can’t perform that action at this time.
0 commit comments