This commit is contained in:
Ilya Kantor 2017-06-03 09:34:00 +03:00
commit 5191617c53
7 changed files with 11 additions and 11 deletions

View file

@ -20,7 +20,7 @@ If you haven't considered selecting an IDE, look at the following variants:
- [Komodo IDE](http://www.activestate.com/komodo-ide) and it's lightweight free version [Komodo Edit](http://www.activestate.com/komodo-edit).
- [Netbeans](http://netbeans.org/).
All of them with the exception of Visual Studio are cross-platform.
All of them with the exception of Visual Studio are cross-platform. Visual Studio is now available for Mac and for Windows (https://www.visualstudio.com/vs/visual-studio-mac/)
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 one for you.

View file

@ -9,13 +9,13 @@ So it's quite common for an engine to implement only the part of the standard.
A good page to see the current state of support for language features is <https://kangax.github.io/compat-table/es6/> (it's big, we have a lot to study yet).
## Babel.JS
## Babel
When we use modern features of the language, some engines may fail to support such code. Just as said, not all features are implemented everywhere.
Here Babel.JS comes to the rescue.
Here Babel comes to the rescue.
[Babel.JS](https://babeljs.io) is a [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler). It rewrites modern JavaScript code into the previous standard.
[Babel](https://babeljs.io) is a [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler). It rewrites modern JavaScript code into the previous standard.
Actually, there are two parts in Babel:
@ -33,7 +33,7 @@ Actually, there are two parts in Babel:
So, we need to setup the transpiler and add the polyfill for old engines to support modern features.
If we orient towards modern engines and do not use features except those supported everywhere, then we don't need to use Babel.JS.
If we orient towards modern engines and do not use features except those supported everywhere, then we don't need to use Babel.
## Examples in the tutorial

View file

@ -156,7 +156,7 @@ function showArgs() {
*/!*
}
showList("John", "Pete", "Alice"); // John - Pete - Alice
showArgs("John", "Pete", "Alice"); // John - Pete - Alice
```
Because `join` resides in `Array.prototype`, we can call it from there directly and rewrite it as:

View file

@ -47,7 +47,7 @@ function User(name, birthday) {
*!*
// only visible from other methods inside User
function calcAge() {
new Date().getFullYear() - birthday.getFullYear();
return new Date().getFullYear() - birthday.getFullYear();
}
*/!*
@ -76,7 +76,7 @@ Like this:
function User(name, birthday) {
// only visible from other methods inside User
function calcAge() {
new Date().getFullYear() - birthday.getFullYear();
return new Date().getFullYear() - birthday.getFullYear();
}
return {

View file

@ -294,7 +294,7 @@ class Article {
*/!*
}
let article = article.createTodays();
let article = Article.createTodays();
alert( articles.title ); // Todays digest
```

View file

@ -125,7 +125,7 @@ class Rabbit extends Animal {
*!*
stop() {
super.stop(); // call parent stop
hide(); // and then hide
this.hide(); // and then hide
}
*/!*
}