Skip to content

Commit 1dcf503

Browse files
authored
add commas
1 parent 206485f commit 1dcf503

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

1-js/05-data-types/04-array/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ But quite often we find that we need an *ordered collection*, where we have a 1s
66

77
It is not convenient to use an object here, because it provides no methods to manage the order of elements. We can’t insert a new property “between” the existing ones. Objects are just not meant for such use.
88

9-
There exists a special data structure named `Array`, to store ordered collections.
9+
There exists a special data structure, named `Array`, to store ordered collections.
1010

1111
## Declaration
1212

@@ -136,7 +136,7 @@ A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is one of th
136136

137137
Arrays support both operations.
138138

139-
In practice we need it very often. For example, a queue of messages that need to be shown on-screen.
139+
In practice, we need it very often. For example, a queue of messages that need to be shown on-screen.
140140

141141
There's another use case for arrays -- the data structure named [stack](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)).
142142

@@ -145,17 +145,17 @@ It supports two operations:
145145
- `push` adds an element to the end.
146146
- `pop` takes an element from the end.
147147

148-
So new elements are added or taken always from the "end".
148+
So new elements are added or taken, always from the "end".
149149

150150
A stack is usually illustrated as a pack of cards: new cards are added to the top or taken from the top:
151151

152152
![](stack.svg)
153153

154154
For stacks, the latest pushed item is received first, that's also called LIFO (Last-In-First-Out) principle. For queues, we have FIFO (First-In-First-Out).
155155

156-
Arrays in JavaScript can work both as a queue and as a stack. They allow you to add/remove elements both to/from the beginning or the end.
156+
Arrays in JavaScript can work both as a queue and as a stack. They allow you to add/remove elements, both to/from the beginning or the end.
157157

158-
In computer science the data structure that allows this, is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue).
158+
In computer science, the data structure that allows this, is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue).
159159

160160
**Methods that work with the end of the array:**
161161

@@ -399,7 +399,7 @@ There is one more syntax to create an array:
399399
let arr = *!*new Array*/!*("Apple", "Pear", "etc");
400400
```
401401

402-
It's rarely used, because square brackets `[]` are shorter. Also there's a tricky feature with it.
402+
It's rarely used, because square brackets `[]` are shorter. Also, there's a tricky feature with it.
403403

404404
If `new Array` is called with a single argument which is a number, then it creates an array *without items, but with the given length*.
405405

0 commit comments

Comments
 (0)