This commit is contained in:
Ilya Kantor 2017-03-19 17:09:37 +03:00
parent e2443e8de6
commit 75e30539ef
73 changed files with 195 additions and 195 deletions

View file

@ -1,6 +1,6 @@
# Hello, world!
The tutorial that you're reading is about the core Javascript, that is platform-independant. So you'll be able to learn how to use Node.JS and other things based on that knowledge.
The tutorial that you're reading is about the core JavaScript, that is platform-independant. So you'll be able to learn how to use Node.JS and other things based on that knowledge.
But we need a working environment to run our scripts, and, just because this book is online, the browser is probably a good choice. We'll use a few browser-specific commands like `alert`, but will keep their amount to the minimum.
@ -133,4 +133,4 @@ The example above can be split into two scripts to work:
- A script in an external file can be inserted with `<script src="path/to/script.js"></script>`.
There is much more about browser scripts and their interaction with the web-page. But let's keep in mind that this part of the tutorial is devoted to Javascript language. So we shouldn't distract ourselves from it. We'll be using a browser as a way to run Javascript, very convenient for online reading, but yet one of many.
There is much more about browser scripts and their interaction with the web-page. But let's keep in mind that this part of the tutorial is devoted to JavaScript language. So we shouldn't distract ourselves from it. We'll be using a browser as a way to run JavaScript, very convenient for online reading, but yet one of many.

View file

@ -66,7 +66,7 @@ We'll see more into working with numbers in the chapter <info:number>.
## A string
A string in Javascript must be quoted.
A string in JavaScript must be quoted.
```js
let str = "Hello";
@ -80,7 +80,7 @@ In JavaScript, there are 3 types of quotes.
2. Single quotes: `'Hello'`.
3. Backticks: <code>&#96;Hello&#96;</code>.
Double and single quotes are "simple" quotes. They mark the beginning and the end of the string, that's all. There's no difference between them in Javascript.
Double and single quotes are "simple" quotes. They mark the beginning and the end of the string, that's all. There's no difference between them in JavaScript.
Backticks are "extended functionality" quotes. They allow to embed variables and expressions into a string by wrapping them in `${…}`, for example:

View file

@ -167,4 +167,4 @@ Most of these rules are easy to understand and memorize. The notable exceptions
- `undefined` is `NaN` as a number.
- `"0"` is true as a boolean.
Objects are not covered here, we'll return to them later in the chapter <info:object-toprimitive>, devoted exclusively to objects, after we learn more basic things about Javascript.
Objects are not covered here, we'll return to them later in the chapter <info:object-toprimitive>, devoted exclusively to objects, after we learn more basic things about JavaScript.

View file

@ -32,7 +32,7 @@ Before we move on, let's grasp the common terminology.
## Strings concatenation, binary +
Now let's see special features of Javascript operators, beyond school arithmetics.
Now let's see special features of JavaScript operators, beyond school arithmetics.
Usually the plus operator `'+'` sums numbers.

View file

@ -1,6 +1,6 @@
# Interaction: alert, prompt, confirm
This part of the tutorial aims to cover Javascript "as is", without environment-specific tweaks.
This part of the tutorial aims to cover JavaScript "as is", without environment-specific tweaks.
But still we use a browser as the demo environment. So we should know at least few user-interface functions.

View file

@ -207,7 +207,7 @@ function showMessage(from, text = anotherFunction()) {
````smart header="Default parameters old-style"
Old editions of Javascript did not support default parameters. So there are alternative ways to support them, that you can find mostly in the old scripts.
Old editions of JavaScript did not support default parameters. So there are alternative ways to support them, that you can find mostly in the old scripts.
For instance, an explicit check for being `undefined`:
@ -322,7 +322,7 @@ For long expressions, it may be tempting sometimes to put them on a separate lin
return
(some + long + expression + or + whatever * f(a) + f(b))
```
That doesn't work, because Javascript assumes a semicolon after `return` in that case:
That doesn't work, because JavaScript assumes a semicolon after `return` in that case:
```js
return*!*;*/!*

View file

@ -1,6 +1,6 @@
# Function expressions and arrows
In Javascript a function is not a "magical language structure", but a special kind of value.
In JavaScript a function is not a "magical language structure", but a special kind of value.
The syntax that we used before is called *Function Declaration*:
@ -159,7 +159,7 @@ ask(
Here functions are declared right inside the `ask(...)` call. They have no name, and so are called *anonymous*. Such functions are not accessible outside of `ask`, but that's just what we want here.
Such code appears in our scripts very naturally, it's in the spirit of Javascript.
Such code appears in our scripts very naturally, it's in the spirit of JavaScript.
```smart header="A function is a value representing an \"action\""

View file

@ -1,4 +1,4 @@
# Javascript specials
# JavaScript specials
This chapter aims to list features of JavaScript that we've learned, paying special attention to subtle moments.
@ -233,7 +233,7 @@ Details in: <info:switch>.
## Functions
We covered 3 ways to create a function in Javascript:
We covered 3 ways to create a function in JavaScript:
1. Function Declaration: the function in the main code flow
@ -291,6 +291,6 @@ More: see <info:function-basics>, <info:function-expressions-arrows>.
## More to come
That was a brief list of Javascript specials that we need to know to code well.
That was a brief list of JavaScript specials that we need to know to code well.
As of now that were only basics. Further in the tutorial you'll find more specials and advanced features of Javascript.
As of now that were only basics. Further in the tutorial you'll find more specials and advanced features of JavaScript.