commit
374bd26393
3 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ In object-oriented programming, a *class* is an extensible program-code-template
|
||||||
|
|
||||||
There's a special syntax construct and a keyword `class` in JavaScript. But before studying it, we should consider that the term "class" comes from the theory of object-oriented programming. The definition is cited above, and it's language-independent.
|
There's a special syntax construct and a keyword `class` in JavaScript. But before studying it, we should consider that the term "class" comes from the theory of object-oriented programming. The definition is cited above, and it's language-independent.
|
||||||
|
|
||||||
In JavaScript there are several well-known programming patterns to make classes even without using the `class` keyword. People talk about "classes" meaning no only those defined with `class`, but also with these patterns.
|
In JavaScript there are several well-known programming patterns to make classes even without using the `class` keyword. People talk about "classes" meaning not only those defined with `class`, but also with these patterns.
|
||||||
|
|
||||||
The `class` construct will be described in the next chapter, but in JavaScript it's a "syntax sugar" and an extension of the prototypal class pattern described here.
|
The `class` construct will be described in the next chapter, but in JavaScript it's a "syntax sugar" and an extension of the prototypal class pattern described here.
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Export and import statements that we covered in previous chaters are called "static".
|
Export and import statements that we covered in previous chaters are called "static".
|
||||||
|
|
||||||
What's because they are indeed static. The syntax is very strict.
|
That's because they are indeed static. The syntax is very strict.
|
||||||
|
|
||||||
First, we can't dynamicaly generate any parameters of `import`.
|
First, we can't dynamicaly generate any parameters of `import`.
|
||||||
|
|
||||||
|
|
|
@ -266,8 +266,8 @@ All methods `"getElementsBy*"` return a *live* collection. Such collections alwa
|
||||||
|
|
||||||
In the example below, there are two scripts.
|
In the example below, there are two scripts.
|
||||||
|
|
||||||
1. The first one creates a reference to the collection of `<div>`. As of now, it's length is `1`.
|
1. The first one creates a reference to the collection of `<div>`. As of now, its length is `1`.
|
||||||
2. The second scripts runs after the browser meets one more `<div>`, so it's length is `2`.
|
2. The second scripts runs after the browser meets one more `<div>`, so its length is `2`.
|
||||||
|
|
||||||
```html run
|
```html run
|
||||||
<div>First div</div>
|
<div>First div</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue