Skip to content

Commit

Permalink
Fix typo on Chapter 5, Section 5.
Browse files Browse the repository at this point in the history
Section  5.1 is titled "5.1. Indicies" , should be "Indices".

Thanks for the book :)!
  • Loading branch information
Joseworks committed Nov 12, 2014
1 parent 39ee9f7 commit 510bca1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* [Comparators](conditional/comparators.md)
* [Concatenate](conditional/concatenate.md)
* [Arrays](arrays/README.md)
* [Indicies](arrays/indicies.md)
* [Indices](arrays/indices.md)
* [Length](arrays/length.md)
* [Loops](loops/README.md)
* [For](loops/for.md)
Expand Down
12 changes: 6 additions & 6 deletions arrays/indicies.md → arrays/indices.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Indicies
# Indices

So you have your array of data elements, but what if you want to access a specific element? That is where indicies come in. An **index** refers to a spot in the array. Indicies logically progress one by one, but it should be noted that the first index in an array is 0, as it is in most languages. Brackets [] are used to signify you are referring to an index of an array.
So you have your array of data elements, but what if you want to access a specific element? That is where indices come in. An **index** refers to a spot in the array. indices logically progress one by one, but it should be noted that the first index in an array is 0, as it is in most languages. Brackets [] are used to signify you are referring to an index of an array.

```javascript
// This is an array of strings
var fruits = ["apple", "banana", "pineapple", "strawberry"];

// We set the variable banana to the value of the second element of
// the fruits array. Remember that indicies start at 0, so 1 is the
// the fruits array. Remember that indices start at 0, so 1 is the
// second element. Result: banana = "banana"
var banana = fruits[1];
```
---

Define the variables using the indices of the array
Define the variables using the indices of the array

```js
var cars = ["Mazda", "Honda", "Chevy", "Ford"]
var honda =
var ford =
var honda =
var ford =
var chevy =
var mazda =
```
Expand Down

0 comments on commit 510bca1

Please sign in to comment.