Skip to content

Sync with upstream @ 06979543 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 20, 2019
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Async iteration and generators
# Async iterators and generators

Asynchronous iterators allow to iterate over data that comes asynchronously, on-demand.

Expand Down
14 changes: 7 additions & 7 deletions 9-regular-expressions/01-regexp-introduction/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <h2> by default
alert( "<h1> <h2> <h3>".search(regexp));
```
````

Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<<<<<<< HEAD
# The Modern JavaScript Tutorial in Korean

This repository hosts the translation of <https://javascript.info> in Korean.
=======
# The Modern JavaScript Tutorial

This repository hosts the English content of the Modern JavaScript Tutorial, published at [https://javascript.info](https://javascript.info).
>>>>>>> 069795438d355d7088f22470cfa6529149e11af7

Please help us to make the translation better.

Expand All @@ -9,6 +15,7 @@ Please help us to make the translation better.
- Add a comment to that issue to inform the maintainer that you're translating it.
- Fork the repository, translate and send a PR when done.

<<<<<<< HEAD
🎉 Thank you!

Your name and the contribution size will appear in the "About project" page when the translation gets published.
Expand All @@ -18,9 +25,19 @@ P.S. The full list of languages can be found at <https://github.com/javascript-t
## Structure

Every chapter, an article or a task resides in its own folder.
=======
See <https://github.com/javascript-tutorial/translate> for the details.

## Contributions

We'd also like to collaborate on the tutorial with other people.

Something's wrong? A topic is missing? Explain it to people, add as PR 👏
>>>>>>> 069795438d355d7088f22470cfa6529149e11af7

The folder is named `N-url`, where `N` – is the number for sorting (articles are ordered), and `url` is the URL-slug on the site.

<<<<<<< HEAD
The folder has one of files:

- `index.md` for a section,
Expand Down Expand Up @@ -87,6 +104,11 @@ Example:
```

For links to MDN, that are only partially translated, also use the language-specific version.
=======
The list of contributors is available at <https://javascript.info/about#contributors>.

## Structure
>>>>>>> 069795438d355d7088f22470cfa6529149e11af7

If a linked article has no translated version, leave the link "as is".

Expand All @@ -95,4 +117,14 @@ If a linked article has no translated version, leave the link "as is".

You can run the tutorial locally, to immediately see the changes on-site.

<<<<<<< HEAD
The server is at <https://github.com/javascript-tutorial/server>.
=======
Each of these files starts from the `# Main header`.

It's very easy to add something new.

---
💓
Ilya Kantor
>>>>>>> 069795438d355d7088f22470cfa6529149e11af7