From 1dcf503dce39d01880d96ecdadd8ada69129e00b Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Fri, 6 May 2022 19:49:20 +0600 Subject: [PATCH 1/2] add commas --- 1-js/05-data-types/04-array/article.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md index 95a78f29..00bc3d60 100644 --- a/1-js/05-data-types/04-array/article.md +++ b/1-js/05-data-types/04-array/article.md @@ -6,7 +6,7 @@ But quite often we find that we need an *ordered collection*, where we have a 1s 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. -There exists a special data structure named `Array`, to store ordered collections. +There exists a special data structure, named `Array`, to store ordered collections. ## Declaration @@ -136,7 +136,7 @@ A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is one of th Arrays support both operations. -In practice we need it very often. For example, a queue of messages that need to be shown on-screen. +In practice, we need it very often. For example, a queue of messages that need to be shown on-screen. There's another use case for arrays -- the data structure named [stack](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)). @@ -145,7 +145,7 @@ It supports two operations: - `push` adds an element to the end. - `pop` takes an element from the end. -So new elements are added or taken always from the "end". +So new elements are added or taken, always from the "end". A stack is usually illustrated as a pack of cards: new cards are added to the top or taken from the top: @@ -153,9 +153,9 @@ A stack is usually illustrated as a pack of cards: new cards are added to the to 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). -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. +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. -In computer science the data structure that allows this, is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue). +In computer science, the data structure that allows this, is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue). **Methods that work with the end of the array:** @@ -399,7 +399,7 @@ There is one more syntax to create an array: let arr = *!*new Array*/!*("Apple", "Pear", "etc"); ``` -It's rarely used, because square brackets `[]` are shorter. Also there's a tricky feature with it. +It's rarely used, because square brackets `[]` are shorter. Also, there's a tricky feature with it. 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*. From 88ce8fa79f23dd0192038d9c16c8d8ce706e03df Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Thu, 12 May 2022 18:07:31 +0600 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=BE=20smth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1-js/05-data-types/04-array/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md index 00bc3d60..ff11ef2c 100644 --- a/1-js/05-data-types/04-array/article.md +++ b/1-js/05-data-types/04-array/article.md @@ -6,7 +6,7 @@ But quite often we find that we need an *ordered collection*, where we have a 1s 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. -There exists a special data structure, named `Array`, to store ordered collections. +There exists a special data structure named `Array`, to store ordered collections. ## Declaration @@ -136,7 +136,7 @@ A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is one of th Arrays support both operations. -In practice, we need it very often. For example, a queue of messages that need to be shown on-screen. +In practice we need it very often. For example, a queue of messages that need to be shown on-screen. There's another use case for arrays -- the data structure named [stack](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)). @@ -145,7 +145,7 @@ It supports two operations: - `push` adds an element to the end. - `pop` takes an element from the end. -So new elements are added or taken, always from the "end". +So new elements are added or taken always from the "end". A stack is usually illustrated as a pack of cards: new cards are added to the top or taken from the top: