diff --git a/1-js/1-getting-started/1-intro/article.md b/1-js/1-getting-started/1-intro/article.md
index 8d6396cd..f4c6219d 100644
--- a/1-js/1-getting-started/1-intro/article.md
+++ b/1-js/1-getting-started/1-intro/article.md
@@ -1,49 +1,56 @@
# An introduction to JavaScript
-Let's see what's so special about JavaScript, what we can achieve with it and what other technologies coexist with it.
+Let's see what's so special about JavaScript, what we can achieve with it and which other technologies play well with it.
## What is JavaScript?
*JavaScript* was initially created to *"make webpages alive"*.
-The programs in this language are called *scripts*. They are put directly into HTML and execute automatically as it loads.
+The programs in this language are called *scripts*. They can be written right in the HTML and execute automatically as the page loads.
-Scripts are provided and executed a plain text. They don't need a special preparation or compilation to run.
+Scripts are provided and executed a plain text. They don't need a special preparation or a compilation to run.
In this aspect, JavaScript is very different from another language called [Java](http://en.wikipedia.org/wiki/Java).
[smart header="Why JavaScript?"]
When JavaScript was created, it initially had another name: "LiveScript". But Java language was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
-But as it evolved, JavaScript became a fully independent language, with its own specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java altogether.
+But as it evolved, JavaScript became a fully independent language, with its own specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java at all.
-It has quite a few special features that make mastering a bit hard at first, but we'll nicely deal with them later.
[/smart]
-Since the time of its creation, JavaScript evolved.
+At present, JavaScript can execute not only in the browser, but also on the server, or actually on any device where a special program called [an interpreter]("http://en.wikipedia.org/wiki/Interpreter_(computing)") is installed. The execution process is called "an interpretation".
-As of now, JavaScript can execute not only in the browser, but also on the server, or actually on any device where a special program called [an interpreter]("http://en.wikipedia.org/wiki/Interpreter_(computing)") is installed. The execution process is called "an interpretation".
-
-The browser has an embedded JavaScript interpreter, of course. Sometimes it's also called a *JavaScript engine* or a "JavaScript virtual machine".
+The browser has an embedded JavaScript interpreter, sometimes it's also called a "JavaScript engine" or a "JavaScript virtual machine".
Different engines have different "codenames", for example:
-
Chrome and Opera browsers and Node.JS server use [V8 engine]("https://en.wikipedia.org/wiki/V8_(JavaScript_engine)") (hence the same support for modern features).
[V8 engine]("https://en.wikipedia.org/wiki/V8_(JavaScript_engine)") -- in Chrome and Opera.
+
[Gecko]("https://en.wikipedia.org/wiki/Gecko_(software)") -- in Firefox.
...There are other codenames like "Trident", "Chakra" for different versions of IE, "Nitro" and "SquirrelFish" for Safari etc.
-The codenames are usually used when searching for detailed information in the internet. Also, we'll use them further to be more exact. Instead of the words "Chrome supports feature..." we'd rather say "V8 supports feature...", not just because it's more precise, but because that also implies Opera and Node.JS.
+The codenames are good to know. They are used when searching for detailed information in the internet. Also, we'll sometimes reference them further in the tutorial. Instead of the words "Chrome supports feature..." we'd rather say "V8 supports feature...", not just because it's more precise, but because that also implies Opera and Node.JS.
[smart header="Compilation and interpretation"]
-There are in fact two general approaches to execute programs: "compilers" and "interpreters".
+There are two general approaches to execute programs: "compilation" and "interpretation".
-
*Compilers* convert the program text (source code) to binary code (usually) without executing it. This is done by the developer and then the binary code is distributed to the system which actually runs it.
-
*Interpreters*, and in particular the one embedded in the browser -- get the source code and execute it "as is". The source code (script) is distributed to the system as a plain text.
+
*Compilers* convert the program text (source code) to binary code (or kind-of) without executing it. When a developer wants to publish the program, he runs a compiler with the source code and then distributes the binary files that it produces.
+
*Interpreters*, and in particular the one embedded in the browser -- get the source code and execute it "as is".
-Modern interpreters actually combine these approaches into one: the script is distributed as a plain text, but prior to execution is converted to the machine language. That's why JavaScript executes very fast.
+As we can see, an interpretation is simpler. No intermediate steps involved. But a compilation is more powerful, because the binary code is more "machine-friendly" and runs faster at the end user.
+
+Modern javascript engines actually combine these approaches into one:
+
+
The script is written and distributed as a plain text (can be compressed/optimized by so-called "javascript minifiers").
+
The engine (in-browser for the web) reads the script and converts it to the machine language. And then it runs it. That's why JavaScript executes very fast.
+
+Even more than that, the binary code may be adjusted later, through the process of its execution. The engine learns more about the actual data that it works with and then can optimize it better.
+
+
+So the term "interpretation" is used mostly for historical reasons. We do know what there's actually a two-stage (at least) process behind it.
[/smart]
@@ -51,36 +58,38 @@ Modern interpreters actually combine these approaches into one: the script is di
The modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.
-Other capabilities depend on the environment which runs JavaScript. For instance, Node.JS has functionality that allows JavaScript to read/write arbitrary files, perform network requests etc etc.
+Other capabilities depend on the environment which runs JavaScript. For instance, Node.JS has functionality that allows JavaScript to read/write arbitrary files, perform network requests etc.
In the browser JavaScript can do everything related to webpage manipulation, interaction with the user and the webserver.
-In more details, in-browser JavaScript is able to:
+For instance, in-browser JavaScript is able to:
-
Create new HTML tags, remove the existing ones, change styles, hide/show elements...
-
React on user actions, run on mouse clicks, pointer movements, key presses...
-
Send requests over the network to remote servers, download and upload data without reloading the page (a so-called "AJAX" technology)...
-
Get and set cookies, ask for data, show messages...
-
...and can actually do almost anything with the page and it's content!
+
Add new HTML to the page, change the existing content, modify styles.
+
React on user actions, run on mouse clicks, pointer movements, key presses.
+
Send requests over the network to remote servers, download and upload data without reloading the page (a so-called "AJAX" technology).
+
Get and set cookies, prompt user for the data, show messages.
+
Store data in-browser ("localStorage").
## What in-browser JavaScript can NOT do?
-JavaScript abilities in the browser are limited. That is for user safety, mainly not to let an evil webpage access private information or harm the user's data.
+JavaScript abilities in the browser are limited for the sake of the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
+
+The examples of such restrictions are:
JavaScript on the webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS system functions.
-Modern browsers allow it to work with files, but limit the access to a specially created directory called "a sandbox".
+Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `` tag.
-There are ways to interact with camera/microphone and other devices, but they require an explicit user's permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to NSA.
+There are ways to interact with camera/microphone and other devices, but they require an explicit user's permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the NSA.
-
JavaScript may not freely access other pages opened in the same browser. The exception is when the pages come from the same site.
+
Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. Such action is allowed. But even in this case, JavaScript from one page may not access the other if they compe from different sites (from a different domain, protocol or port).
-There are ways to workaround this, of course. But if two pages come from different sites (different domain, protocol or port), they require a special code on *both of them* allowing to interact.
+That is called a "Same Origin Policy". To workaround that, *both pages* must contain a special JavaScript code that handles data exchange.
-The limitation is again for user safety. A page from `http://evilsite.com` which a user has opened occasionaly will be unable to access other browser tabs and steal information from there.
+The limitation is again for a user's safety. A page from `http://anysite.com` which a user has opened occasionaly must not be able to open or access another browser tab with the URL `http://gmail.com` and steal information from there.
JavaScript can easily communicate over the net to the server where the current page came from. But it's ability to receive data from other sites/domains is crippled. Though possible, it requires the explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's safety limitations.
@@ -89,7 +98,7 @@ The limitation is again for user safety. A page from `http://evilsite.com` which
-Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow installing plugin/extensions which get extended permissions.
+Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow installing plugin/extensions which may get extended permissions.
## Why JavaScript is unique?
@@ -106,7 +115,7 @@ Combined, these 3 things only exist in JavaScript and no other browser technolog
That's what makes JavaScript unique. That's why it is the most widespread way of creating browser interfaces.
-Of course, there are certain trends including new languages and browser abilities. While planning to learn a new technology, it's beneficial to check it's perspectives, so we go ahead with that.
+While planning to learn a new technology, it's beneficial to check it's perspectives. So let's move on to the modern trends that include new languages and browser abilities.
## HTML 5
@@ -115,7 +124,7 @@ Of course, there are certain trends including new languages and browser abilitie
Few examples:
-
Read/write files on disk (in a "sandbox", not just any file).
+
Write files on disk (in a "sandbox", not to any folder).
A database embedded in the browser, to keep data on a user's computer and effeciently operate on it.
Multitasking with the usage of many CPU cores in one time.
Audio/video playback.
@@ -128,9 +137,9 @@ Many new abilities are still in progress, but browsers gradually improve the sup
The trend: browser can do more and more, it is becoming more like an all-purpose desktop application.
[/summary]
-Still, there is a small gotcha with those "extra-fresh" modern browser abilities. Sometimes browsers try to implement them on very early stages when they are nor fully defined neither agreed upon, but still are so interesting that the developers just can't wait.
+Still, there is a small gotcha with those "extra-fresh" modern browser abilities. Sometimes browsers try to implement them on very early stages when they are nor fully defined neither agreed upon, but are so interesting that the developers just can't wait.
-...As the time goes, the specification matures and changes, and browsers must adapt it. That may lead to errors in the older code which was too eager to use the early browser implementation. So one should think twice before relying on things that are in draft yet.
+...As the time goes, the specification matures and changes, and browsers must adapt it. That may lead to errors in the older code which was too eager to use the early version. So one should think twice before relying on things that are in draft yet.
But what's great -- eventually all browsers tend to follow the standard. There are much less differences between them now than only a couple years ago.
@@ -152,7 +161,7 @@ The trend: JavaScript is becoming faster, gets new syntax and language features.
The syntax of JavaScript does not suit everyone's needs: some people think that it's too flexible, the others consider it too limited, the third ones want to add new features absent in the standard...
-That's normal, because projects and requirements are different for everyone. There's no a single standard for a carpenter's hammer, why should it exist for the language?
+That's normal, because projects and requirements are different for everyone.
So recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run.
@@ -163,7 +172,7 @@ Examples of such languages:
[CoffeeScript](http://coffeescript.org/) is a "syntax sugar" for JavaScript, it introduces shorter syntax, allowing to write more precise and clear code. Usually Ruby guys like it.
[TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing", to simplify development and support of complex systems. Developed by Microsoft.
-
[Dart](https://www.dartlang.org/) was offered by Google as a replacement for JavaScript, but other leading internet companies declared that they are not interested. Maybe later, we'll see. Right now it can be transpiled to JavaScript, but used less often compared to two previous alternatives.
+
[Dart](https://www.dartlang.org/) is a standalone language that has it's own engine that runs in non-browser environments (like mobile apps). It was initially offered by Google as a replacement for JavaScript, but as of browsers require it to be transpiled to JavaScript just like the ones above.
## Summary
diff --git a/1-js/1-getting-started/3-editor/article.md b/1-js/1-getting-started/3-editor/article.md
index ad6e083d..335c08ad 100644
--- a/1-js/1-getting-started/3-editor/article.md
+++ b/1-js/1-getting-started/3-editor/article.md
@@ -2,21 +2,22 @@
For the comfortable development we need a good code editor.
-It must support at least:
+It should support at least:
Syntax highlight.
Autocompletion.
-
Folding -- hiding/opening blocks of code.
+
Folding -- collapsing/opening blocks of code.
+
...the more features -- the better.
[cut]
## IDE
-The term "IDE" (Integrated Development Environment) -- denotes an editor which is extended by a number of plugins, can work with additional systems, such as bugtrackering, version control and much more.
+The term "IDE" (Integrated Development Environment) -- denotes an advanced editor which can integrate with additional systems, such as bugtrackering, version control etc.
-Usually IDE loads the "project" and then can navigate between files, provide autocompletion based on the whole project, do other "project-level" stuff.
+An IDE operates on a "whole project": loads it and then can navigate between files, provide autocompletion based on the whole project, do other "project-level" stuff.
If you haven't considered selecting an IDE, pleae look at the following variants:
@@ -30,44 +31,43 @@ If you haven't considered selecting an IDE, pleae look at the following variants
All of them with the exception of Visual Studio are cross-platform.
-Most IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose what's most convenient.
+Most IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best for you.
## Lightweight editors
-Lightweight editors are not as powerful as IDE, but they're fast and simple.
+"Lightweight editors" are not as powerful as IDEs, but they're fast and simple.
They are mainly used to instantly open and edit a file.
-The main differenct between a "lightweight editor" and an "IDE" is that the latter works on a project-level, meaning it has to load a lot of data to start, and the former one opens just the files. That's much faster.
+The main difference between a "lightweight editor" and an "IDE" is that the latter works on a project-level, meaning it has to load a lot of data to start, and the former one opens just the files. That's much faster.
-In practice, "lightweight" editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict frontier between a "lightweight editor" and an IDE. There's no point in argueing what is what.
+In practice, "lightweight" editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict border between a lightweight editor and an IDE. There's no point in arguing what is what.
The following options deserve your attention:
-## My editors
+## My favorites
-I believe one should have both an IDE for projects and a lightweight editor for quick-n-fast file editing.
+I believe one should have both an IDE for projects and a lightweight editor for quick and easy file editing.
I'm using:
-
Jetbrains editors as IDE: [WebStorm](http://www.jetbrains.com/webstorm/) for JS and if I have other language in the project, then [PHPStorm (PHP)](http://www.jetbrains.com/phpstorm/), [IDEA (Java)](http://www.jetbrains.com/idea/), [RubyMine (Ruby)](http://www.jetbrains.com/ruby/). These guys provide editors for other languages too, but I didn't use them.
+
[WebStorm](http://www.jetbrains.com/webstorm/) for JS, and if there is one more language in the project, then I switch to other Jetbrains editors like [PHPStorm](http://www.jetbrains.com/phpstorm/) (PHP), [IDEA](http://www.jetbrains.com/idea/) (Java), [RubyMine](http://www.jetbrains.com/ruby/) (Ruby). There are editors for other languages too, but I didn't use them.
Visual Studio, sometimes very rarely if that's a .NET project (Win).
-If you don't know what to choose -- you can consider those.
+If you don't know what to choose -- you can consider these ones.
## Let's not argue
-The editors listed above are those that me or my friends -- good developers use for a long time and happy with them.
+The editors in the lists above are those that me or my friends -- good developers use for a long time and are happy with.
-There are of course other great editors, please choose the one you like the most.
+There are other great editors in our big world, please choose the one you like the most.
The choice of an editor, like any other tool, is individual and depends on your projects, habbits, personal preferences.
diff --git a/1-js/1-getting-started/4-devtools/article.md b/1-js/1-getting-started/4-devtools/article.md
index 24d27625..985c94c3 100644
--- a/1-js/1-getting-started/4-devtools/article.md
+++ b/1-js/1-getting-started/4-devtools/article.md
@@ -1,10 +1,12 @@
# Developer console
-As the last step before we start developing, let's learn the basics of developer console.
+And the last step before we start developing...
A code is error-prone. You are quite likely to have errors... Oh what I'm talking? You are *absolutely* going to make errors, if you're a human, not a [robot]("https://en.wikipedia.org/wiki/Bender_(Futurama)").
-In browser, visitors don't see the errors by default. So, if something goes wrong, we won't see what's broken and can't fix it.
+So let's grasp the basics of developer console.
+
+In browser, a user doesn't see the errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it.
To see errors and get a lot of other useful information about scripts, browsers have embedded "developer tools".
@@ -12,7 +14,7 @@ To see errors and get a lot of other useful information about scripts, browsers
Other browsers also provide developer tools, but are usually in a "catching-up" position, compared to Chrome/Firefox which are the best.
-If there is an error in Internet Explorer only, then we can use it's developer tools, but usually -- Chrome/Firefox.
+If there is an error in the certain browser only, then we can use it's developer tools, but usually -- Chrome/Firefox.
Developer tools are really powerful, there are many features, but on this stage let's just look how to open them, look at errors and run JavaScript commands.
@@ -22,7 +24,7 @@ Developer tools are really powerful, there are many features, but on this stage
Open the page [bug.html](bug.html).
-There's an error in the JavaScript code on it. An ordinary visitor won't see it, we need t open developer tools for that.
+There's an error in the JavaScript code on it. An ordinary visitor won't see it, so let's open developer tools.
Press the key [key F12] or, if you're on Mac, then [key Cmd+Opt+J].
@@ -39,7 +41,7 @@ The exact look depends on your Chrome version. It changes from time to time, but
On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occured.
-In that very Console tab next to the blue `>` symbol, we can also type JavaScript commands and press enter to run them ([key Shift+Enter] to input multiline commands).
+Below the error message there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands and press enter to run them ([key Shift+Enter] to input multiline commands).
Now we can see errors and that's enough for the start. We'll be back to developer tools later and cover debugging more in-depth in the chapter [](/debugging-chrome).
@@ -47,11 +49,11 @@ Now we can see errors and that's enough for the start. We'll be back to develope
For Safari, we need to enable the "Develop menu" first.
-It is done on the "Advanced" pane of the preferences:
+There's a checkbox for that at the bottom of the "Advanced" pane of the preferences:
-Now [key Cmd+Opt+C] can toggle the console. Also the new top menu item has appeared with many useful options.
+Now [key Cmd+Opt+C] can toggle the console. Also note that the new top menu item has appeared with many useful options.
## Other browsers
@@ -62,7 +64,7 @@ The look & feel of them is quite similar, once we know how to use one of them (c
## Summary
-
Developer tools allow us to see errors (crucial now), run commands, examine variables and much more.
+
Developer tools allow us to see errors, run commands, examine variables and much more.
They can be opened with [key F12] for most browsers under Windows. Chrome for Mac needs [key Cmd+Opt+J], Safari: [key Cmd+Opt+C] (need to enable first).
diff --git a/1-js/10-es-modern/1-es-modern-usage/article.md b/1-js/10-es-modern/1-es-modern-usage/article.md
deleted file mode 100644
index 86b8b7ff..00000000
--- a/1-js/10-es-modern/1-es-modern-usage/article.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# ES-2015 сейчас
-
-[Стандарт ES-2015](http://www.ecma-international.org/publications/standards/Ecma-262.htm) был принят в июне 2015. Пока что большинство браузеров реализуют его частично, текущее состояние реализации различных возможностей можно посмотреть здесь: [](https://kangax.github.io/compat-table/es6/).
-
-Когда стандарт будет более-менее поддерживаться во всех браузерах, то весь учебник будет обновлён в соответствии с ним. Пока же, как центральное место для "сбора" современных фич JavaScript, создан этот раздел.
-
-Чтобы писать код на ES-2015 прямо сейчас, есть следующие варианты.
-
-## Конкретный движок JS
-
-Самое простое -- это когда нужен один конкретный движок JS, например V8 (Chrome).
-
-Тогда можно использовать только то, что поддерживается именно в нём. Заметим, что в V8 большинство возможностей ES-2015 поддерживаются только при включённом `use strict`.
-
-При разработке на Node.JS обычно так и делают. Если же нужна кросс-браузерная поддержка, то этот вариант не подойдёт.
-
-## Babel.JS
-
-[Babel.JS](https://babeljs.io) -- это [транспайлер](https://en.wikipedia.org/wiki/Source-to-source_compiler), переписывающий код на ES-2015 в код на предыдущем стандарте ES5.
-
-Он состоит из двух частей:
-
-
-
Собственно транспайлер, который переписывает код.
-
Полифилл, который добавляет методы `Array.from`, `String.prototype.repeat` и другие.
-
-
-На странице [](https://babeljs.io/repl/) можно поэкспериментировать с транспайлером: слева вводится код в ES-2015, а справа появляется результат его преобразования в ES5.
-
-Обычно Babel.JS работает на сервере в составе системы сборки JS-кода (например [webpack](http://webpack.github.io/) или [brunch](http://brunch.io/)) и автоматически переписывает весь код в ES5.
-
-Настройка такой конвертации тривиальна, единственно -- нужно поднять саму систему сборки, а добавить к ней Babel легко, плагины есть к любой из них.
-
-Если же хочется "поиграться", то можно использовать и браузерный вариант Babel.
-
-Это выглядит так:
-
-```html
-
-*!*
-
-
-*/!*
-
-
-```
-
-Сверху подключается браузерный скрипт `browser.min.js` из пакета Babel. Он включает в себя полифилл и транспайлер. Далее он автоматически транслирует и выполняет скрипты с `type="text/babel"`.
-
-Размер `browser.min.js` превышает 1 мегабайт, поэтому такое использование в production строго не рекомендуется.
-
-# Примеры на этом сайте
-
-[warn header="Только при поддержке браузера"]
-Запускаемые примеры с ES-2015 будут работать только если ваш браузер поддерживает соответствующую возможность стандарта.
-[/warn]
-
-Это означает, что при запуске примеров в браузере, который их не поддерживает, будет ошибка. Это не означает, что пример неправильный! Просто пока нет поддержки...
-
-Рекомендуется [Chrome Canary](https://www.google.com/chrome/browser/canary.html) большинство примеров в нём работает. [Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/channel/#developer) тоже неплох в поддержке современного стандарта, но на момент написания этого текста переменные [let](/let-const) работают только при указании `version=1.7` в типе скрипта: `
-
-
-
-