From ef91e0916f96dd6ee61278313df4aa85394d89e7 Mon Sep 17 00:00:00 2001 From: haider Date: Wed, 17 Apr 2019 23:02:23 +0500 Subject: [PATCH 01/48] Fixed syntax error / typo not a biggie --- 5-network/07-xmlhttprequest/article.md | 1 - 1 file changed, 1 deletion(-) diff --git a/5-network/07-xmlhttprequest/article.md b/5-network/07-xmlhttprequest/article.md index ffc54401..eeaf0a8a 100644 --- a/5-network/07-xmlhttprequest/article.md +++ b/5-network/07-xmlhttprequest/article.md @@ -350,7 +350,6 @@ For instance: xhr.open("POST", "/article/xmlhttprequest/post/user"); xhr.send(formData); - xhr. ``` From 17223e64d6e33f55d6a2697f34d6db26b6ae0e60 Mon Sep 17 00:00:00 2001 From: John McGuinness Date: Thu, 18 Apr 2019 08:16:17 +1000 Subject: [PATCH 02/48] Update index.md --- 2-ui/2-events/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-ui/2-events/index.md b/2-ui/2-events/index.md index 07f06fdd..f4996083 100644 --- a/2-ui/2-events/index.md +++ b/2-ui/2-events/index.md @@ -1,3 +1,3 @@ -# Introduction into Events +# Introduction to Events An introduction to browser events, event properties and handling patterns. From f776557046036b750ef8cfd82d628f9c16ea9c3a Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Thu, 18 Apr 2019 16:03:05 +1000 Subject: [PATCH 03/48] import typo --- 1-js/13-modules/02-import-export/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/13-modules/02-import-export/article.md b/1-js/13-modules/02-import-export/article.md index 1e1df336..ff703c6e 100644 --- a/1-js/13-modules/02-import-export/article.md +++ b/1-js/13-modules/02-import-export/article.md @@ -355,7 +355,7 @@ export {login, logout}; import User from './user.js'; export {User}; -import Githib from './providers/github.js'; +import Github from './providers/github.js'; export {Github}; ... ``` @@ -370,7 +370,7 @@ export {login, logout} from './helpers.js'; export {default as User} from './user.js'; -export {default as Githib} from './providers/github.js'; +export {default as Github} from './providers/github.js'; ... ``` From a63d623bd2e830a6d352ff3784d86e62d6029ae9 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Thu, 18 Apr 2019 18:11:29 +1000 Subject: [PATCH 04/48] vise -> vice --- 6-data-storage/01-cookie/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/6-data-storage/01-cookie/article.md b/6-data-storage/01-cookie/article.md index fcf52f40..ee16cb36 100644 --- a/6-data-storage/01-cookie/article.md +++ b/6-data-storage/01-cookie/article.md @@ -167,7 +167,7 @@ document.cookie = "user=John; max-age=0"; The cookie should be transferred only over HTTPS. -**By default, if we set a cookie at `http://site.com`, then it also appears at `https://site.com` and vise versa.** +**By default, if we set a cookie at `http://site.com`, then it also appears at `https://site.com` and vice versa.** That is, cookies are domain-based, they do not distinguish between the protocols. From 922170b619459fc67013502e71741d0dce7cc50f Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Thu, 18 Apr 2019 18:26:51 +1000 Subject: [PATCH 05/48] thee -> the --- 6-data-storage/03-indexeddb/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/6-data-storage/03-indexeddb/article.md b/6-data-storage/03-indexeddb/article.md index dbe38674..d7fc5bbb 100644 --- a/6-data-storage/03-indexeddb/article.md +++ b/6-data-storage/03-indexeddb/article.md @@ -142,7 +142,7 @@ To do an upgrade, there are two main ways: 1. We can compare versions and run per-version operations. 2. Or we can get a list of existing object stores as `db.objectStoreNames`. That object is a [DOMStringList](https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#domstringlist), and it provides `contains(name)` method to check for the existance. And then we can do updates depending on what exists. -Here's the demo of thee second approach: +Here's the demo of the second approach: ```js let openRequest = indexedDB.open("db", 1); From 4f6864e1b088edf6ac9b04b31659875d74912287 Mon Sep 17 00:00:00 2001 From: Sergey Zelenov Date: Fri, 19 Apr 2019 14:10:06 +0200 Subject: [PATCH 06/48] fix typo in article title iteration -> iterators --- .../2-async-iterators-generators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/12-generators-iterators/2-async-iterators-generators/article.md b/1-js/12-generators-iterators/2-async-iterators-generators/article.md index ad393677..7b59fd5c 100644 --- a/1-js/12-generators-iterators/2-async-iterators-generators/article.md +++ b/1-js/12-generators-iterators/2-async-iterators-generators/article.md @@ -1,5 +1,5 @@ -# Async iteration and generators +# Async iterators and generators Asynchronous iterators allow to iterate over data that comes asynchronously, on-demand. From 811491d8b8d2336a8f8c8c9dfceced63f36a56f7 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:05:16 +0300 Subject: [PATCH 07/48] Update README.md --- README.md | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 63d48988..efa92ae2 100755 --- a/README.md +++ b/README.md @@ -1,32 +1,20 @@ -# The JavaScript Tutorial +# The Modern JavaScript Tutorial -This repository hosts the content of the Modern JavaScript Tutorial, published at [https://javascript.info](https://javascript.info). +This repository hosts the English content of the Modern JavaScript Tutorial, published at [https://javascript.info](https://javascript.info). ## Translations We'd like to make the tutorial available in many languages. Please help us to translate. -Here's the list of existing ongoing translations (in alphabetical order): +The full list of existing translations is at . -| Language | Github | Translation leads | Translated (%) |       Last Commit       | Published | -|----------|--------|-------------------|----------------|-------------|-----------| -| Azerbaijani | [orkhan-huseyn/javascript-tutorial-az](https://github.com/orkhan-huseyn/javascript-tutorial-az) | @orkhan-huseyn | ![](http://stats.javascript.info/translate/az.svg) | ![](https://img.shields.io/github/last-commit/orkhan-huseyn/javascript-tutorial-az.svg?maxAge=900&label=) | | -| Chinese | [xitu/javascript-tutorial-zh](https://github.com/xitu/javascript-tutorial-zh) | @leviding | ![](http://stats.javascript.info/translate/zh.svg) | ![](https://img.shields.io/github/last-commit/xitu/javascript-tutorial-zh.svg?maxAge=900&label=) | [zh.javascript.info](https://zh.javascript.info) | -| French | [HachemiH/javascript-tutorial-fr](https://github.com/HachemiH/javascript-tutorial-fr) | @HachemiH | ![](http://stats.javascript.info/translate/fr.svg) | ![](https://img.shields.io/github/last-commit/HachemiH/javascript-tutorial-fr.svg?maxAge=900&label=) | | -| Japanese | [KenjiI/javascript-tutorial-ja](https://github.com/KenjiI/javascript-tutorial-ja) | @KenjiI | ![](http://stats.javascript.info/translate/ja.svg) | ![](https://img.shields.io/github/last-commit/KenjiI/javascript-tutorial-ja.svg?maxAge=900&label=) | [ja.javascript.info](https://ja.javascript.info) | -| Korean | [Violet-Bora-Lee/javascript-tutorial-ko](https://github.com/Violet-Bora-Lee/javascript-tutorial-ko) | @Violet-Bora-Lee | ![](http://stats.javascript.info/translate/ko.svg) | ![](https://img.shields.io/github/last-commit/Violet-Bora-Lee/javascript-tutorial-ko.svg?maxAge=900&label=) | | -| Persian (Farsi) | [mehradsadeghi/javascript-tutorial-fa](https://github.com/mehradsadeghi/javascript-tutorial-fa) | @mehradsadeghi | started | ![](https://img.shields.io/github/last-commit/krzmaciek/javascript-tutorial-pl.svg?maxAge=900&label=) | | -| Polish | [krzmaciek/javascript-tutorial-pl](https://github.com/krzmaciek/javascript-tutorial-pl) | @krzmaciek | ![](http://stats.javascript.info/translate/pl.svg) | ![](https://img.shields.io/github/last-commit/krzmaciek/javascript-tutorial-pl.svg?maxAge=900&label=) | | -| Romanian | [lighthousand/javascript-tutorial-ro](https://github.com/lighthousand/javascript-tutorial-ro) | @lighthousand | ![](http://stats.javascript.info/translate/ro.svg) | ![](https://img.shields.io/github/last-commit/lighthousand/javascript-tutorial-ro.svg?maxAge=900&label=) | | -| Russian | [iliakan/javascript-tutorial-ru](https://github.com/iliakan/javascript-tutorial-ru) | @iliakan | * . | ![](https://img.shields.io/github/last-commit/iliakan/javascript-tutorial-ru.svg?maxAge=900&label=) | [learn.javascript.ru](https://learn.javascript.ru) | -| Turkish | [sahinyanlik/javascript-tutorial-tr](https://github.com/sahinyanlik/javascript-tutorial-tr) | @sahinyanlik | ![](http://stats.javascript.info/translate/tr.svg) | ![](https://img.shields.io/github/last-commit/sahinyanlik/javascript-tutorial-tr.svg?maxAge=900&label=) | | +## Contributions -`*` – the previous version is published in Russian, need to backport/translate the new one from English. +We'd also like to collaborate on the tutorial with other people. -**If you'd like to translate it into your language:** +A topic is missing? Explain it to people, add as PR πŸ‘ -1. First, check if the translation has already started in the list above or in issues. If it exists, contact the original lead, ask him to join efforts. If the translation is stalled, ask him to transfer the repo to you or just create a new one and continue from where they stopped. -2. If there's no such translation, create a new one. Clone the repository, change its name to `javascript-tutorial-` (by your language) and [create an issue](https://github.com/iliakan/javascript-tutorial-en/issues/new) for me to add you to the list. +Adding a new article is very easy. **You can edit the text in any editor.** The tutorial uses enhanced "markdown" format, easy to grasp. And if you want to see how it looks on-site, there's a server to run the tutorial locally at . @@ -43,3 +31,7 @@ The type of the material is defined by the file inside the folder: - `task.md` stands for a task (solution must be provided in `solution.md` file aswell) Each of these files starts from the `# Main header`. + +--- +πŸ’“ +Ilya Kantor From c62633c8b183e8ab41148f1e854c9457414b71fe Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:05:36 +0300 Subject: [PATCH 08/48] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index efa92ae2..92ab6088 100755 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ The type of the material is defined by the file inside the folder: Each of these files starts from the `# Main header`. +It's very easy to add something new. + --- πŸ’“ Ilya Kantor From b79ba7da8aefe8a87a32a9733081e62c7f7bcefa Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:05:50 +0300 Subject: [PATCH 09/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92ab6088..e7dda5d8 100755 --- a/README.md +++ b/README.md @@ -36,4 +36,4 @@ It's very easy to add something new. --- πŸ’“ -Ilya Kantor +@iliakan From 75c51cf447e024b2fd87b6bc049cf8a38a93e2f9 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:06:18 +0300 Subject: [PATCH 10/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7dda5d8..c64ec2d0 100755 --- a/README.md +++ b/README.md @@ -35,5 +35,5 @@ Each of these files starts from the `# Main header`. It's very easy to add something new. --- -πŸ’“ -@iliakan +πŸ’“ +Ilya Kantor From f3ea9763a1c70188bd58891660c80c39fc181073 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:06:56 +0300 Subject: [PATCH 11/48] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c64ec2d0..c3adee98 100755 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ We'd also like to collaborate on the tutorial with other people. A topic is missing? Explain it to people, add as PR πŸ‘ -Adding a new article is very easy. - **You can edit the text in any editor.** The tutorial uses enhanced "markdown" format, easy to grasp. And if you want to see how it looks on-site, there's a server to run the tutorial locally at . ## Structure From f6a7c12ea7666ba25e1ce6e77fb4859f266ad322 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:07:14 +0300 Subject: [PATCH 12/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3adee98..cca58958 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The full list of existing translations is at . From becdb24ec796d3ba201f9225216b6106ebcbd739 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:07:48 +0300 Subject: [PATCH 13/48] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cca58958..933bcc7f 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Something's wrong? A topic is missing? Explain it to people, add as PR πŸ‘ **You can edit the text in any editor.** The tutorial uses enhanced "markdown" format, easy to grasp. And if you want to see how it looks on-site, there's a server to run the tutorial locally at . +The list of contributors is available at . + ## Structure Every chapter, article or a task has its folder. From 08fa87003d4d167fb79441521906d36481b8dca3 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:08:49 +0300 Subject: [PATCH 14/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 933bcc7f..76b37015 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository hosts the English content of the Modern JavaScript Tutorial, pub We'd like to make the tutorial available in many languages. Please help us to translate. -The full list of existing translations is at . +The list of existing translations and details are at . ## Contributions From df0c224bd193560941107aff80976014a0b2e3b6 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:35:28 +0300 Subject: [PATCH 15/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76b37015..0c24a1d4 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository hosts the English content of the Modern JavaScript Tutorial, pub We'd like to make the tutorial available in many languages. Please help us to translate. -The list of existing translations and details are at . +The details are at . ## Contributions From 79f0463dc4d9447e4aebf9be26751547c07230f3 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 02:35:43 +0300 Subject: [PATCH 16/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c24a1d4..bdf600ee 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository hosts the English content of the Modern JavaScript Tutorial, pub We'd like to make the tutorial available in many languages. Please help us to translate. -The details are at . +See for the details. ## Contributions From 557d170c81de98d2ff67670bf9ffa0e8b216fc20 Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Sat, 20 Apr 2019 14:39:00 +0530 Subject: [PATCH 17/48] Update solution.md Changed the sign on line 32,33. --- 1-js/05-data-types/04-array/10-maximal-subarray/solution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/05-data-types/04-array/10-maximal-subarray/solution.md b/1-js/05-data-types/04-array/10-maximal-subarray/solution.md index edf39289..daadf494 100644 --- a/1-js/05-data-types/04-array/10-maximal-subarray/solution.md +++ b/1-js/05-data-types/04-array/10-maximal-subarray/solution.md @@ -29,8 +29,8 @@ For instance, for `[-1, 2, 3, -9, 11]`: -9 -9 + 11 -// Starting from -11 --11 +// Starting from 11 +11 ``` The code is actually a nested loop: the external loop over array elements, and the internal counts subsums starting with the current element. From 069795438d355d7088f22470cfa6529149e11af7 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 20 Apr 2019 12:33:05 +0300 Subject: [PATCH 18/48] minor --- .../01-regexp-introduction/article.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/9-regular-expressions/01-regexp-introduction/article.md b/9-regular-expressions/01-regexp-introduction/article.md index 571beecb..59775d3c 100644 --- a/9-regular-expressions/01-regexp-introduction/article.md +++ b/9-regular-expressions/01-regexp-introduction/article.md @@ -65,18 +65,18 @@ From here on the color scheme is: ````smart header="When to use `new RegExp`?" -Normally we use the short syntax `/.../`. But it does not allow any variable insertions, so we must know the exact regexp at the time of writing the code. +Normally we use the short syntax `/.../`. But it does not support variable insertions `${...}`. -On the other hand, `new RegExp` allows to construct a pattern dynamically from a string. +On the other hand, `new RegExp` allows to construct a pattern dynamically from a string, so it's more flexible. -So we can figure out what we need to search and create `new RegExp` from it: +Here's an example of a dynamically generated regexp: ```js run -let search = prompt("What you want to search?", "love"); -let regexp = new RegExp(search); +let tag = prompt("Which tag you want to search?", "h2"); +let regexp = new RegExp(`<${tag}>`); -// find whatever the user wants -alert( "I love JavaScript".search(regexp)); +// finds

by default +alert( "

".search(regexp)); ``` ```` From 65e805c70ee8bc9474fb67de1d9cd3d737d1478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=88=D0=B0=20=D0=91=D0=B0=D1=80=D1=81=D0=B5?= =?UTF-8?q?=D0=B3=D1=8F=D0=BD?= <32730665+mihansweatpants@users.noreply.github.com> Date: Sat, 20 Apr 2019 18:42:08 +0300 Subject: [PATCH 19/48] Minor grammar fix Remove word "to" after a modal verb --- 8-web-components/4-template-element/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8-web-components/4-template-element/article.md b/8-web-components/4-template-element/article.md index 41dbceb1..4d9df9cb 100644 --- a/8-web-components/4-template-element/article.md +++ b/8-web-components/4-template-element/article.md @@ -3,7 +3,7 @@ A built-in `