Skip to content

Commit

Permalink
Added a note in line 16 (freeCodeCamp#1403)
Browse files Browse the repository at this point in the history
Explained that the position in an array starts at 0 as opposed to 1.
  • Loading branch information
avishk1 authored and IsaacAbrahamson committed Oct 27, 2017
1 parent 8b5acb2 commit 011b58f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ var array = [1, 2, 3];
array[0]; // equals 1
var data = array[1]; // sets the data variable to 2
```

Note: The index for arrays start from 0 as opposed to 1. Hence, array[0] equals 1. You can also think of it as position. In the above example 1 resides in position 0, 2 in position 1 and 3 in position 2.

0 comments on commit 011b58f

Please sign in to comment.