Skip to content

Commit 76c2ca1

Browse files
committed
docs(array): reword for clarity and tone
1 parent 79022ca commit 76c2ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/content/part02/array.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Arrays are a sequential collection of elements that can be accessed randomly usi
2929

3030
==== Insertion
3131

32-
Arrays are a built-in part of most languages. In JavaScript, populating an array is simple; elements can either be added at the time of initialization, or after. Below you can find an example of both cases:
32+
Arrays are a built-in part of most languages. In JavaScript, populating an array is simple; elements can either be added at the time of initialization, or after. See below for examples of both cases:
3333

3434
.Inserting elements into an array
3535
[source, javascript]
@@ -46,7 +46,7 @@ console.log(array2.length); // 101
4646
console.log(array2); // [empty × 3, 1, empty × 96, 2]
4747
----
4848

49-
Using the index, you can replace whatever value you want. Also, you don't have to add items next to each other. The size of the array will dynamically expand to accommodate the data. You can reference values in whatever index you like index 3 or even 100! In the `array2` we inserted 2 numbers, but the length is 101, and there are 99 empty spaces.
49+
Using the index, you can access and/or modify any value you choose. Also, you can reference values in any index you choose. The size of the array will dynamically expand to accommodate the data. For example, in `array2` 2 numbers have been inserted, but the length is 101, and there are 99 empty spaces.
5050
The runtime for inserting elements using index is always is constant: _O(1)_.
5151

5252
===== Inserting at the beginning of the array

0 commit comments

Comments
 (0)