diff --git a/1-js/1-getting-started/2-es-modern-now/article.md b/1-js/1-getting-started/2-es-modern-now/article.md index c582b2de..31913d72 100644 --- a/1-js/1-getting-started/2-es-modern-now/article.md +++ b/1-js/1-getting-started/2-es-modern-now/article.md @@ -5,8 +5,14 @@ The [latest standard](http://www.ecma-international.org/publications/standards/E As it includes a lot of new features, most browsers implement them partially. You can find the current state of the support at [](https://kangax.github.io/compat-table/es6/). +## Single-engine app + If a project is developed for a single JavaScript engine, like V8 (Node.JS, Chrome), then we can use V8-supported features. That's a lot. +Most notably, V8 supports many of the new features only if the code is running in the "strict mode" (modern mode), which should be enabled explicitly using a directive `'use strict';` at the start. + +You will find most code in this tutorial using this directive and, because of that, runnable in Chrome. + But what if we're writing a cross-browser application? Different browsers support different subsets of ES-2015. Here comes Babel.JS. @@ -68,13 +74,13 @@ That doesn't mean that the example is wrong! It's just the browser lacking the s [Chrome Canary](https://www.google.com/chrome/browser/canary.html) is recommended, most examples work in it. -[Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/channel/#developer) is fine too, but it has certain glitches. Like: [let](/let-const) variables working only with when the script type contains `version=1.7` or `1.8`: ` diff --git a/1-js/2-first-steps/11-uibasic/article.md b/1-js/2-first-steps/11-uibasic/article.md index 381e2cd7..0ba8975b 100644 --- a/1-js/2-first-steps/11-uibasic/article.md +++ b/1-js/2-first-steps/11-uibasic/article.md @@ -45,7 +45,7 @@ As with `alert`, the `prompt` window is modal. ```js //+ run -var age = prompt('How old are you?', 100); +let age = prompt('How old are you?', 100); alert(`You are ${age} years old!`) ``` @@ -57,14 +57,14 @@ Run this code in Internet Explorer to see that: ```js //+ run -var test = prompt("Test"); +let test = prompt("Test"); ``` So, to look good in IE, it's recommended to always provide the second argument: ```js //+ run -var test = prompt("Test", ''); // <-- for IE +let test = prompt("Test", ''); // <-- for IE ``` [/warn] @@ -85,7 +85,7 @@ For example: ```js //+ run -var isBoss = confirm("Are you the boss?"); +let isBoss = confirm("Are you the boss?"); alert( isBoss ); // true is OK is pressed ``` diff --git a/1-js/2-first-steps/12-ifelse/2-check-standard/ifelse_task2/index.html b/1-js/2-first-steps/12-ifelse/2-check-standard/ifelse_task2/index.html index b6e3b589..52a68f1d 100644 --- a/1-js/2-first-steps/12-ifelse/2-check-standard/ifelse_task2/index.html +++ b/1-js/2-first-steps/12-ifelse/2-check-standard/ifelse_task2/index.html @@ -3,7 +3,9 @@