From 1b31575e0dbe53196bac89acd40a6554465e8de0 Mon Sep 17 00:00:00 2001 From: joaquinelio Date: Sun, 15 Aug 2021 16:36:58 -0300 Subject: [PATCH 01/14] promise chain flow --- 1-js/11-async/03-promise-chaining/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/11-async/03-promise-chaining/article.md b/1-js/11-async/03-promise-chaining/article.md index 4c7d7d7ab..1c6a7fd8d 100644 --- a/1-js/11-async/03-promise-chaining/article.md +++ b/1-js/11-async/03-promise-chaining/article.md @@ -36,7 +36,7 @@ The idea is that the result is passed through the chain of `.then` handlers. Here the flow is: 1. The initial promise resolves in 1 second `(*)`, -2. Then the `.then` handler is called `(**)`. +2. Then the `.then` handler is called `(**)` wich in turn creates a new promise. 3. The value that it returns is passed to the next `.then` handler `(***)` 4. ...and so on. @@ -44,7 +44,7 @@ As the result is passed along the chain of handlers, we can see a sequence of `a ![](promise-then-chain.svg) -The whole thing works, because a call to `promise.then` returns a promise, so that we can call the next `.then` on it. +The whole thing works, because every call to a `.then` returns a new promise, so that we can call the next `.then` on it. When a handler returns a value, it becomes the result of that promise, so the next `.then` is called with it. From 8287e24b96e6bcdfa7c8493397a8ede262aa9229 Mon Sep 17 00:00:00 2001 From: joaquinelio Date: Mon, 16 Aug 2021 11:17:55 -0300 Subject: [PATCH 02/14] edge --- 1-js/01-getting-started/1-intro/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/01-getting-started/1-intro/article.md b/1-js/01-getting-started/1-intro/article.md index f81e52822..f8dc45ea6 100644 --- a/1-js/01-getting-started/1-intro/article.md +++ b/1-js/01-getting-started/1-intro/article.md @@ -24,11 +24,11 @@ The browser has an embedded engine sometimes called a "JavaScript virtual machin Different engines have different "codenames". For example: -- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera. +- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge. - [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox. - ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc. -The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome and Opera. +The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome, Opera and Edge. ```smart header="How do engines work?" From 623737b79e53073c335eca372faabd253fab1594 Mon Sep 17 00:00:00 2001 From: David Eisner Date: Fri, 20 Aug 2021 20:31:14 -0400 Subject: [PATCH 03/14] Update article.md Fix typo, minor grammar fix. --- 4-binary/02-text-decoder/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4-binary/02-text-decoder/article.md b/4-binary/02-text-decoder/article.md index 3d836e6c0..a0c80145c 100644 --- a/4-binary/02-text-decoder/article.md +++ b/4-binary/02-text-decoder/article.md @@ -2,7 +2,7 @@ What if the binary data is actually a string? For instance, we received a file with textual data. -The build-in [TextDecoder](https://encoding.spec.whatwg.org/#interface-textdecoder) object allows to read the value into an actual JavaScript string, given the buffer and the encoding. +The built-in [TextDecoder](https://encoding.spec.whatwg.org/#interface-textdecoder) object allows one to read the value into an actual JavaScript string, given the buffer and the encoding. We first need to create it: ```js From 22b7b515510668ec71ec7a657433b517702273a8 Mon Sep 17 00:00:00 2001 From: wilburn98 Date: Thu, 26 Aug 2021 11:17:19 +0800 Subject: [PATCH 04/14] Update article.md --- 2-ui/5-loading/02-script-async-defer/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-ui/5-loading/02-script-async-defer/article.md b/2-ui/5-loading/02-script-async-defer/article.md index 93c32a7f5..22497e207 100644 --- a/2-ui/5-loading/02-script-async-defer/article.md +++ b/2-ui/5-loading/02-script-async-defer/article.md @@ -193,7 +193,7 @@ In practice, `defer` is used for scripts that need the whole DOM and/or their re And `async` is used for independent scripts, like counters or ads. And their relative execution order does not matter. ```warn header="Page without scripts should be usable" -Please note: if you're using `defer` or `async`, then user will see the the page *before* the script loads. +Please note: if you're using `defer` or `async`, then user will see the page *before* the script loads. In such case, some graphical components are probably not initialized yet. From e69a94338ea90f5ed280fca4ee2e4ba8c49360b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E4=B9=9D=E9=BC=8E?= <109224573@qq.com> Date: Fri, 27 Aug 2021 13:33:47 +0800 Subject: [PATCH 05/14] Update urls --- 1-js/03-code-quality/02-coding-style/article.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1-js/03-code-quality/02-coding-style/article.md b/1-js/03-code-quality/02-coding-style/article.md index 982f41c4d..904f0a939 100644 --- a/1-js/03-code-quality/02-coding-style/article.md +++ b/1-js/03-code-quality/02-coding-style/article.md @@ -301,11 +301,11 @@ The great thing about them is that style-checking can also find some bugs, like Here are some well-known linting tools: -- [JSLint](http://www.jslint.com/) -- one of the first linters. -- [JSHint](http://www.jshint.com/) -- more settings than JSLint. -- [ESLint](http://eslint.org/) -- probably the newest one. +- [JSLint](https://www.jslint.com/) -- one of the first linters. +- [JSHint](https://jshint.com/) -- more settings than JSLint. +- [ESLint](https://eslint.org/) -- probably the newest one. -All of them can do the job. The author uses [ESLint](http://eslint.org/). +All of them can do the job. The author uses [ESLint](https://eslint.org/). Most linters are integrated with many popular editors: just enable the plugin in the editor and configure the style. @@ -335,7 +335,7 @@ Here's an example of an `.eslintrc` file: Here the directive `"extends"` denotes that the configuration is based on the "eslint:recommended" set of settings. After that, we specify our own. -It is also possible to download style rule sets from the web and extend them instead. See for more details about installation. +It is also possible to download style rule sets from the web and extend them instead. See for more details about installation. Also certain IDEs have built-in linting, which is convenient but not as customizable as ESLint. From 08a530820e187d856901518e5e82dfa98a03890a Mon Sep 17 00:00:00 2001 From: zhangbao Date: Sun, 12 Sep 2021 00:09:46 +0800 Subject: [PATCH 06/14] Update article.md Visual Studio Code has been introduced as an "IDE", so it should no longer appear under "Lightweight editors" --- 1-js/01-getting-started/3-code-editors/article.md | 1 - 1 file changed, 1 deletion(-) diff --git a/1-js/01-getting-started/3-code-editors/article.md b/1-js/01-getting-started/3-code-editors/article.md index d03f03def..6532e54a3 100644 --- a/1-js/01-getting-started/3-code-editors/article.md +++ b/1-js/01-getting-started/3-code-editors/article.md @@ -32,7 +32,6 @@ In practice, lightweight editors may have a lot of plugins including directory-l The following options deserve your attention: - [Atom](https://atom.io/) (cross-platform, free). -- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free). - [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware). - [Notepad++](https://notepad-plus-plus.org/) (Windows, free). - [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them. From 10590969eb1dbb61e2090a8cbf230d9795af1697 Mon Sep 17 00:00:00 2001 From: Osvaldo Dias dos Santos Date: Tue, 14 Sep 2021 11:52:12 +0100 Subject: [PATCH 07/14] Update URL. --- 1-js/04-object-basics/02-object-copy/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/04-object-basics/02-object-copy/article.md b/1-js/04-object-basics/02-object-copy/article.md index cafb71cac..b56a8034b 100644 --- a/1-js/04-object-basics/02-object-copy/article.md +++ b/1-js/04-object-basics/02-object-copy/article.md @@ -133,7 +133,7 @@ clone.name = "Pete"; // changed the data in it alert( user.name ); // still John in the original object ``` -Also we can use the method [Object.assign](mdn:js/Object/assign) for that. +Also we can use the method [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) for that. The syntax is: From df39e1a9988e21296ef118306964837e3b498ef4 Mon Sep 17 00:00:00 2001 From: Vlad <69749436+xirly@users.noreply.github.com> Date: Wed, 15 Sep 2021 01:00:26 +0300 Subject: [PATCH 08/14] Update article.md --- 1-js/05-data-types/01-primitives-methods/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/01-primitives-methods/article.md b/1-js/05-data-types/01-primitives-methods/article.md index 552c3b3b6..930a304f7 100644 --- a/1-js/05-data-types/01-primitives-methods/article.md +++ b/1-js/05-data-types/01-primitives-methods/article.md @@ -48,7 +48,7 @@ The solution looks a little bit awkward, but here it is: 2. The language allows access to methods and properties of strings, numbers, booleans and symbols. 3. In order for that to work, a special "object wrapper" that provides the extra functionality is created, and then is destroyed. -The "object wrappers" are different for each primitive type and are called: `String`, `Number`, `Boolean` and `Symbol`. Thus, they provide different sets of methods. +The "object wrappers" are different for each primitive type and are called: `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. Thus, they provide different sets of methods. For instance, there exists a string method [str.toUpperCase()](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) that returns a capitalized `str`. From 76ef12647162d7eba514abcc8303fe4207fcb35f Mon Sep 17 00:00:00 2001 From: Rizky <41568558+rizkyzhang@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:49:02 +0700 Subject: [PATCH 09/14] Fix typo That importance -> The importance --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 97f5d738a..78c4fd2f1 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -123,7 +123,7 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl It means that `||` processes its arguments until the first truthy value is reached, and then the value is returned immediately, without even touching the other argument. - That importance of this feature becomes obvious if an operand isn't just a value, but an expression with a side effect, such as a variable assignment or a function call. + The importance of this feature becomes obvious if an operand isn't just a value, but an expression with a side effect, such as a variable assignment or a function call. In the example below, only the second message is printed: From 7651ae0a6cea63bfc4f0d68a149f125eba0aec61 Mon Sep 17 00:00:00 2001 From: Fiona Tang <79673633+fionatagious@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:08:59 -0700 Subject: [PATCH 10/14] minor typo --- 1-js/02-first-steps/09-comparison/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/09-comparison/article.md b/1-js/02-first-steps/09-comparison/article.md index ead7922ff..a69317fee 100644 --- a/1-js/02-first-steps/09-comparison/article.md +++ b/1-js/02-first-steps/09-comparison/article.md @@ -7,7 +7,7 @@ In JavaScript they are written like this: - Greater/less than: a > b, a < b. - Greater/less than or equals: a >= b, a <= b. - Equals: `a == b`, please note the double equality sign `==` means the equality test, while a single one `a = b` means an assignment. -- Not equals. In maths the notation is , but in JavaScript it's written as a != b. +- Not equals: In maths the notation is , but in JavaScript it's written as a != b. In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities. From 2f980540fb6688dd8bb98e2257e6324fbe26f01d Mon Sep 17 00:00:00 2001 From: Mahdyar Hasanpour Date: Mon, 4 Oct 2021 18:44:46 +0330 Subject: [PATCH 11/14] chore: fix a typo --- .../05-output-single-linked-list-reverse/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md b/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md index 4357ff208..0eb76ea1c 100644 --- a/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md +++ b/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md @@ -33,7 +33,7 @@ printReverseList(list); # Using a loop -The loop variant is also a little bit more complicated then the direct output. +The loop variant is also a little bit more complicated than the direct output. There is no way to get the last value in our `list`. We also can't "go back". From f4801c3a1705cf42372886c6f960c0b7e8f403bc Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sun, 10 Oct 2021 18:21:14 +0300 Subject: [PATCH 12/14] closes #2738 --- .../3-events-change-input/article.md | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/2-ui/4-forms-controls/3-events-change-input/article.md b/2-ui/4-forms-controls/3-events-change-input/article.md index 6865e2a40..3a64869f7 100644 --- a/2-ui/4-forms-controls/3-events-change-input/article.md +++ b/2-ui/4-forms-controls/3-events-change-input/article.md @@ -58,31 +58,50 @@ So we can't use `event.preventDefault()` there -- it's just too late, there woul These events occur on cutting/copying/pasting a value. -They belong to [ClipboardEvent](https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces) class and provide access to the data that is copied/pasted. +They belong to [ClipboardEvent](https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces) class and provide access to the data that is cut/copied/pasted. We also can use `event.preventDefault()` to abort the action, then nothing gets copied/pasted. -For instance, the code below prevents all such events and shows what we are trying to cut/copy/paste: +For instance, the code below prevents all `cut/copy/paste` events and shows the text we're trying to cut/copy/paste: ```html autorun height=40 run ``` -Please note, that it's possible to copy/paste not just text, but everything. For instance, we can copy a file in the OS file manager, and paste it. +Please note: inside `cut` and `copy` event handlers a call to `event.clipboardData.getData(...)` returns an empty string. That's because technically the data isn't in the clipboard yet. If we use `event.preventDefault()` it won't be copied at all. -That's because `clipboardData` implements `DataTransfer` interface, commonly used for drag'n'drop and copy/pasting. It's bit beyond our scope now, but you can find its methods [in the specification](https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface). +So the example above uses `document.getSelection()` to get the selected text. You can find more details about document selection in the article . -```warn header="ClipboardAPI: user safety restrictions" -The clipboard is a "global" OS-level thing. So most browsers allow read/write access to the clipboard only in the scope of certain user actions for the safety, e.g. in `onclick` event handlers. +It's possible to copy/paste not just text, but everything. For instance, we can copy a file in the OS file manager, and paste it. -Also it's forbidden to generate "custom" clipboard events with `dispatchEvent` in all browsers except Firefox. -``` +That's because `clipboardData` implements `DataTransfer` interface, commonly used for drag'n'drop and copy/pasting. It's bit beyond our scope now, but you can find its methods in the [DataTransfer specification](https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface). + +Also, there's an additional asynchronous API of accessing the clipboard: `navigator.clipboard`. More about it in the specification [Clipboard API and events](https://www.w3.org/TR/clipboard-apis/), [not supported by Firefox](https://caniuse.com/async-clipboard). + +### Safety restrictions + +The clipboard is a "global" OS-level thing. A user may switch between various applications, copy/paste different things, and a browser page shouldn't see all that. + +So most browsers allow seamless read/write access to the clipboard only in the scope of certain user actions, such as copying/pasting etc. + +It's forbidden to generate "custom" clipboard events with `dispatchEvent` in all browsers except Firefox. And even if we manage to dispatch such event, the specification clearly states that such "syntetic" events must not provide access to the clipboard. + +Even if someone decides to save `event.clipboardData` in an event handler, and then access it later -- it won't work. + +To reiterate, [event.clipboardData](https://www.w3.org/TR/clipboard-apis/#clipboardevent-clipboarddata) works solely in the context of user-initiated event handlers. + +On the other hand, [navigator.clipboard](https://www.w3.org/TR/clipboard-apis/#h-navigator-clipboard) is the more recent API, meant for use in any context. It asks for user permission, if needed. Not supported in Firefox. ## Summary @@ -92,4 +111,4 @@ Data change events: |---------|----------|-------------| | `change`| A value was changed. | For text inputs triggers on focus loss. | | `input` | For text inputs on every change. | Triggers immediately unlike `change`. | -| `cut/copy/paste` | Cut/copy/paste actions. | The action can be prevented. The `event.clipboardData` property gives read/write access to the clipboard. | +| `cut/copy/paste` | Cut/copy/paste actions. | The action can be prevented. The `event.clipboardData` property gives access to the clipboard. All browsers except Firefox also support `navigator.clipboard`. | From f1210b4f7b2180a6fda4156aefbc7d2b777e1c53 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sun, 10 Oct 2021 18:51:05 +0300 Subject: [PATCH 13/14] minor --- 1-js/11-async/03-promise-chaining/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/11-async/03-promise-chaining/article.md b/1-js/11-async/03-promise-chaining/article.md index 1c6a7fd8d..f675d72ec 100644 --- a/1-js/11-async/03-promise-chaining/article.md +++ b/1-js/11-async/03-promise-chaining/article.md @@ -36,8 +36,8 @@ The idea is that the result is passed through the chain of `.then` handlers. Here the flow is: 1. The initial promise resolves in 1 second `(*)`, -2. Then the `.then` handler is called `(**)` wich in turn creates a new promise. -3. The value that it returns is passed to the next `.then` handler `(***)` +2. Then the `.then` handler is called `(**)`, which in turn creates a new promise (resolved with `2` value). +3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes the next handler. 4. ...and so on. As the result is passed along the chain of handlers, we can see a sequence of `alert` calls: `1` -> `2` -> `4`. From 227af850bcf2cbd8e0491f8720c03a7d28b146ee Mon Sep 17 00:00:00 2001 From: tarasyyyk Date: Mon, 11 Oct 2021 11:10:29 +0300 Subject: [PATCH 14/14] Sync with upstream @ 193319c9 --- 1-js/01-getting-started/1-intro/article.md | 12 ++-------- .../3-code-editors/article.md | 8 ------- 1-js/02-first-steps/09-comparison/article.md | 9 +------- .../11-logical-operators/article.md | 4 ---- .../02-coding-style/article.md | 22 +++++-------------- .../02-object-copy/article.md | 6 +---- .../01-primitives-methods/article.md | 6 +---- .../solution.md | 6 +---- 8 files changed, 11 insertions(+), 62 deletions(-) diff --git a/1-js/01-getting-started/1-intro/article.md b/1-js/01-getting-started/1-intro/article.md index 85c0b9b3c..ae989715a 100644 --- a/1-js/01-getting-started/1-intro/article.md +++ b/1-js/01-getting-started/1-intro/article.md @@ -24,19 +24,11 @@ Різні рушії мають різні "кодові назви". Наприклад: -<<<<<<< HEAD -- [V8](https://uk.wikipedia.org/wiki/V8_(рушій_JavaScript)) -- в Chrome і Opera. +- [V8](https://uk.wikipedia.org/wiki/V8_(рушій_JavaScript)) -- в Chrome, Opera та Edge. - [SpiderMonkey](https://uk.wikipedia.org/wiki/SpiderMonkey) -- в Firefox. - ...Є також інші кодові назви як "Chakra" для IE, "JavaScriptCore", "Nitro" і "SquirrelFish" для Safari, та інші. -Написані вище терміни добре було б запам’ятати, оскільки вони використовуються в статтях розробників на просторах інтернету. Ми також будемо їх використовувати. Наприклад, якщо "можливість X підтримується в V8", тоді ймовірно це буде працювати в Chrome і Opera. -======= -- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge. -- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox. -- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc. - -The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome, Opera and Edge. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Написані вище терміни добре було б запам’ятати, оскільки вони використовуються в статтях розробників на просторах інтернету. Ми також будемо їх використовувати. Наприклад, якщо "можливість X підтримується в V8", тоді ймовірно це буде працювати в Chrome, Opera та Edge. ```smart header="Як рушії працюють?" diff --git a/1-js/01-getting-started/3-code-editors/article.md b/1-js/01-getting-started/3-code-editors/article.md index ce34771f9..ad2100fe0 100644 --- a/1-js/01-getting-started/3-code-editors/article.md +++ b/1-js/01-getting-started/3-code-editors/article.md @@ -31,18 +31,10 @@ IDE завантажує проект (який може мати багато Ось ці варіанти заслуговують вашої уваги: -<<<<<<< HEAD - [Atom](https://atom.io/) (багатоплатформний, безкоштовний). -- [Visual Studio Code](https://code.visualstudio.com/) (багатоплатформний, безкоштовний). - [Sublime Text](http://www.sublimetext.com) (багатоплатформний, випробувальний термін). - [Notepad++](https://notepad-plus-plus.org/) (Windows, безкоштовний). - [Vim](http://www.vim.org/) та [Emacs](https://www.gnu.org/software/emacs/) також хороші, якщо знати, як ними користуватися. -======= -- [Atom](https://atom.io/) (cross-platform, free). -- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware). -- [Notepad++](https://notepad-plus-plus.org/) (Windows, free). -- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 ## Не будемо сперечатися diff --git a/1-js/02-first-steps/09-comparison/article.md b/1-js/02-first-steps/09-comparison/article.md index d48105961..2f0e72390 100644 --- a/1-js/02-first-steps/09-comparison/article.md +++ b/1-js/02-first-steps/09-comparison/article.md @@ -4,17 +4,10 @@ В JavaScript вони записуються ось так: -<<<<<<< HEAD - Більше/менше: a > b, a < b. - Більше/менше або дорівнює: a >= b, a <= b. - Дорівнює: `a == b`. Зверніть увагу, для порівняння потрібно використовувати два знаки рівності `==`. Один знак рівності `a = b` означав б присвоєння. -- Не дорівнює. В математиці позначається символом , проте в JavaScript записується як a != b. -======= -- Greater/less than: a > b, a < b. -- Greater/less than or equals: a >= b, a <= b. -- Equals: `a == b`, please note the double equality sign `==` means the equality test, while a single one `a = b` means an assignment. -- Not equals: In maths the notation is , but in JavaScript it's written as a != b. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +- Не дорівнює: в математиці позначається символом , проте в JavaScript записується як a != b. В цьому розділі ми вивчимо різні типи порівнянь, узнаємо, як JavaScript їх виконує, та розглянемо важливі особливості. diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 65c0f527e..968267399 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -123,11 +123,7 @@ alert( undefined || null || 0 ); // 0 (усі хибні, повертаєтьс Це означає, що оператор `||` опрацьовує аргументи доти, доки не досягається перше правдиве значення, після чого це значення негайно повертається, без подальшого опрацювання решти аргументів. -<<<<<<< HEAD Важливість такої особливості стає очевидною, якщо операнд є не просто змінною, а виразом із побічним ефектом, як-от присвоєння змінної або виклик функції. -======= - The importance of this feature becomes obvious if an operand isn't just a value, but an expression with a side effect, such as a variable assignment or a function call. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 У наведеному нижче прикладі виведеться лише друге повідомлення: diff --git a/1-js/03-code-quality/02-coding-style/article.md b/1-js/03-code-quality/02-coding-style/article.md index e487301bd..34b95fb81 100644 --- a/1-js/03-code-quality/02-coding-style/article.md +++ b/1-js/03-code-quality/02-coding-style/article.md @@ -301,19 +301,11 @@ function pow(x, n) { Ось декілька добре відомих засобів для перевірки: -<<<<<<< HEAD -- [JSLint](http://www.jslint.com/) -- один з перших лінтерів. -- [JSHint](http://www.jshint.com/) -- має більше налаштувань ніж JSLint. -- [ESLint](http://eslint.org/) -- напевно, найсучасніший лінтер. +- [JSLint](https://www.jslint.com/) -- один з перших лінтерів. +- [JSHint](https://www.jshint.com/) -- має більше налаштувань ніж JSLint. +- [ESLint](https://eslint.org/) -- напевно, найсучасніший лінтер. -Всі вони роблять свою справу. Автор використовує [ESLint](http://eslint.org/). -======= -- [JSLint](https://www.jslint.com/) -- one of the first linters. -- [JSHint](https://jshint.com/) -- more settings than JSLint. -- [ESLint](https://eslint.org/) -- probably the newest one. - -All of them can do the job. The author uses [ESLint](https://eslint.org/). ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Всі вони роблять свою справу. Автор використовує [ESLint](https://eslint.org/). Більшість лінтерів інтегровані в популярні редактори: просто увімкніть відповідний плаґін в редакторі і налаштуйте стиль. @@ -343,11 +335,7 @@ All of them can do the job. The author uses [ESLint](https://eslint.org/). Директива `"extends"` означає, що конфігурація базується на наборі налаштувань "eslint:recommended". Після цього, ви вказуєте ваші власні. -<<<<<<< HEAD -Крім того, можна завантажити набори правил з мережі та розширити їх. Дивіться для отримання більш детальної інструкції зі встановлення. -======= -It is also possible to download style rule sets from the web and extend them instead. See for more details about installation. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Крім того, можна завантажити набори правил з мережі та розширити їх. Дивіться для отримання більш детальної інструкції зі встановлення. Також, деякі середовища розробки (IDE) мають вбудовані засоби первірки коду, що є зручним, але не таким гнучким в налаштуванні рішенням, як ESLint. diff --git a/1-js/04-object-basics/02-object-copy/article.md b/1-js/04-object-basics/02-object-copy/article.md index d3f048dec..3a172b7b6 100644 --- a/1-js/04-object-basics/02-object-copy/article.md +++ b/1-js/04-object-basics/02-object-copy/article.md @@ -133,11 +133,7 @@ clone.name = "Петро"; // змінемо його вміст alert( user.name ); // як і раніше Іван залишився в оригінальному об’єкті ``` -<<<<<<< HEAD -Також ми можемо використати метод [Object.assign](mdn:js/Object/assign) для цього. -======= -Also we can use the method [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) for that. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Також ми можемо використати метод [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) для цього. Його синтаксис: diff --git a/1-js/05-data-types/01-primitives-methods/article.md b/1-js/05-data-types/01-primitives-methods/article.md index d4bf40f64..6e94c8531 100644 --- a/1-js/05-data-types/01-primitives-methods/article.md +++ b/1-js/05-data-types/01-primitives-methods/article.md @@ -48,11 +48,7 @@ john.sayHi(); // Привіт друже! 2. JavaScript дозволяє отримати доступ до методів та властивостей рядків, чисел, булеанів та символів. 3. Для цього створюється спеціальний "об’єкт обгортка" з додатковою функціональністю, та потім він знищується. -<<<<<<< HEAD -Для кожного примітиву створюється своя "обгортка": `String`, `Number`, `Boolean` та `Symbol`. Отже, вони містять різні набори методів. -======= -The "object wrappers" are different for each primitive type and are called: `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. Thus, they provide different sets of methods. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Для кожного примітиву створюється своя "обгортка": `String`, `Number`, `Boolean`, `Symbol` та `BigInt`. Отже, вони містять різні набори методів. Наприклад: існує такий метод для рядка, як [str.toUpperCase()](https://developer.mozilla.org/uk/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase), який поверне рядок `str` з великими літерами. diff --git a/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md b/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md index a2f5e9e87..039778180 100644 --- a/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md +++ b/1-js/06-advanced-functions/01-recursion/05-output-single-linked-list-reverse/solution.md @@ -33,11 +33,7 @@ printReverseList(list); # За допомогою циклу -<<<<<<< HEAD -Варіант циклу також трохи складніше, ніж прямий вивід. -======= -The loop variant is also a little bit more complicated than the direct output. ->>>>>>> 193319c963b9ba86ac7d9590f7261a36ecdcc4d2 +Варіант з циклом також трохи складніший, ніж прямий вивід. Немає можливості отримати останнє значення в нашому `list`. Ми також не можемо "повернутися назад".