You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/content/part02/array.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,15 @@ Arrays are a sequential collection of elements that can be accessed randomly usi
29
29
30
30
==== Insertion
31
31
32
-
Arrays are built-in into most languages. Inserting an element is simple; you can either add them on creation time or after initialization. Below you can find an example for 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. Below you can find an example of both cases:
33
33
34
34
.Inserting elements into an array
35
35
[source, javascript]
36
36
----
37
-
// (1) Add elements at the creation time:
37
+
// (1) Initialize an array pre-populated with elements:
38
38
const array = [2, 5, 1, 9, 6, 7];
39
39
40
-
// (2) initialize an empty array and add values later
40
+
// (2) initialize an empty array and add elements later
0 commit comments