This commit is contained in:
Ilya Kantor 2017-06-17 17:20:45 +03:00
commit ae1a1a0941
6 changed files with 6 additions and 6 deletions

View file

@ -268,7 +268,7 @@ Operators `++` and `--` can be placed both after and before the variable.
Both of these records do the same: increase `i` by `1`.
Is there any difference? Yes, but we can only see it if we use the retured value of `++/--`.
Is there any difference? Yes, but we can only see it if we use the returned value of `++/--`.
Let's clarify. As we know, all operators return a value. Increment/decrement is not an exception here. The prefix form returns the new value, while the postfix form returns the old value (prior to increment/decrement).

View file

@ -235,7 +235,7 @@ The combination: "infinite loop + `break` as needed" is great for situations whe
## Continue to the next iteration [#continue]
The `continue` directive is a "lighter version" of `break`. It doesn't stop the whole loop. Instead if stops the current iteration and forces the loop to start a new one (if the condition allows).
The `continue` directive is a "lighter version" of `break`. It doesn't stop the whole loop. Instead it stops the current iteration and forces the loop to start a new one (if the condition allows).
We can use it if we're done on the current iteration and would like to move on to the next.

View file

@ -79,7 +79,7 @@ function showMessage() {
alert(message);
}
showMessage(); // Hello, my name is John
showMessage(); // Hello, John
```
The function has full access to the outer variable. It can modify it as well.

View file

@ -472,7 +472,7 @@ Each DOM node belongs to a certain class. The classes form a hierarchy. The full
Main DOM node properties are:
`nodeType`
: Node type. We can get it from the DOM object class, but often we need just to see is it a text or element node. The `nodeType` property is good for that. It has numeric values, most important are: `1` -- for elements,`3` -- for text nodes. Read-only.
: Node type. We can get it from the DOM object class, but often we need just to see if it is a text or element node. The `nodeType` property is good for that. It has numeric values, most important are: `1` -- for elements,`3` -- for text nodes. Read-only.
`nodeName/tagName`
: For elements, tag name (uppercased unless XML-mode). For non-element nodes `nodeName` describes what is it. Read-only.

View file

@ -10,7 +10,7 @@ But the attribute-property mapping is not one-to-one! In this chapter we'll pay
## DOM properties
We've already seen built-in DOM properties. There's a lot. But technically no one limits us, and if it's not enough -- we can add own own.
We've already seen built-in DOM properties. There's a lot. But technically no one limits us, and if it's not enough -- we can add our own.
DOM nodes are regular JavaScript objects. We can alter them.

View file

@ -153,7 +153,7 @@ These methods are "old school": they exist from the ancient times and we can mee
For instance, how to insert *html* if we have it as a string? Or, given a node, how to insert another node *before* it? Of course, all that is doable, but not in an elegant way.
So there exist two other sets of insertion methods to handle all cases easily.
So there exists two other sets of insertion methods to handle all cases easily.
### prepend/append/before/after