You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/1-intro/article.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,12 @@ The browser has an embedded engine, sometimes it's also called a "JavaScript vir
25
25
Different engines have different "codenames", for example:
26
26
27
27
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
28
-
-[Gecko](https://en.wikipedia.org/wiki/Gecko_(software)) -- in Firefox.
28
+
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
29
29
- ...There are other codenames like "Trident", "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari etc.
30
30
31
31
The terms above are good to remember, because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome and Opera.
32
32
33
-
```smart header="How engines work?"
33
+
```smart header="How do engines work?"
34
34
35
35
Engines are complicated. But the basics are easy.
36
36
@@ -108,7 +108,7 @@ Modern tools make the transpilation very fast and transparent, actually allowing
108
108
109
109
Examples of such languages:
110
110
111
-
-[CoffeeScript](http://coffeescript.org/) is a "syntax sugar" for JavaScript, it introduces shorter syntax, allowing to write more precise and clear code. Usually Ruby devs like it.
111
+
-[CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript, it introduces shorter syntax, allowing to write more precise and clear code. Usually Ruby devs like it.
112
112
-[TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing", to simplify development and support of complex systems. It is developed by Microsoft.
113
113
-[Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps). It was initially offered by Google as a replacement for JavaScript, but as of now, browsers require it to be transpiled to JavaScript just like the ones above.
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/2-code-editors/article.md
+7-13
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,22 @@
1
1
# Code editors
2
2
3
-
A code editor is the place where a programmer spends most of his time.
3
+
A code editor is the place where programmers spend most of their time.
4
4
5
5
There are two archetypes: IDE and lightweight editors. Many people feel comfortable choosing one tool of each type.
6
6
7
-
[cut]
8
-
9
7
## IDE
10
8
11
-
The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) means a powerful editor with many features that usually operates on a "whole project". As said, that's not just an editor, but a full-scale "development environment".
9
+
The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) means a powerful editor with many features that usually operates on a "whole project". As the name suggests, that's not just an editor, but a full-scale "development environment".
12
10
13
-
An IDE loads the project (can be many files), and then allows navigation between files, provides autocompletion based on the whole project, integrates with a version management system (like [git](https://git-scm.com/)), a testing environment and other "project-level" stuff.
11
+
An IDE loads the project (can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), integrates with a version management system (like [git](https://git-scm.com/)), a testing environment and other "project-level" stuff.
14
12
15
13
If you haven't considered selecting an IDE yet, look at the following variants:
16
14
17
-
-IntelliJ editors: [WebStorm](http://www.jetbrains.com/webstorm/) for frontend development and [PHPStorm (PHP)](http://www.jetbrains.com/phpstorm/), [IDEA (Java)](http://www.jetbrains.com/idea/), [RubyMine (Ruby)](http://www.jetbrains.com/ruby/) and others if you need additional languages.
15
+
-[WebStorm](http://www.jetbrains.com/webstorm/) for frontend development and other editors of the same company if you need additional languages.
18
16
- Visual Studio is fine if you're a .NET developer, and a free version is available ([Visual Studio Community](https://www.visualstudio.com/vs/community/))
19
-
- Eclipse-based products, like [Aptana](http://www.aptana.com/) and Zend Studio.
20
-
-[Komodo IDE](http://www.activestate.com/komodo-ide) and its lightweight free version [Komodo Edit](http://www.activestate.com/komodo-edit).
21
17
-[Netbeans](http://netbeans.org/).
22
18
23
-
All of the IDEs listed above are available on both Windows and Mac, and the IDEs other than Visual Studio are also available on Linux.
19
+
All of the IDEs except Visual Studio are available on Windows, MacOs and Linux. Visual Studio doesn't work on Linux.
24
20
25
21
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.
26
22
@@ -40,19 +36,17 @@ The following options deserve your attention:
- Vim and Emacs are also cool, if you know how to use them.
39
+
-[Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool, if you know how to use them.
44
40
45
41
## My favorites
46
42
47
43
The personal preference of the author is to have both an IDE for projects and a lightweight editor for quick and easy file editing.
48
44
49
45
I'm using:
50
46
51
-
-[WebStorm](http://www.jetbrains.com/webstorm/) for JS, and if there is one more language in the project, then I switch to other Jetbrains editors like [PHPStorm](http://www.jetbrains.com/phpstorm/) (PHP), [IDEA](http://www.jetbrains.com/idea/) (Java), [RubyMine](http://www.jetbrains.com/ruby/) (Ruby). There are editors for other languages too, but I haven't used them.
47
+
-[WebStorm](http://www.jetbrains.com/webstorm/) for JS, and if there is one more language in the project, then I switch to one of the other Jetbrains offerings listed above.
52
48
- As a lightweight editor -- [Sublime Text](http://www.sublimetext.com) or [Atom](https://atom.io/).
53
49
54
-
If you don't know what to choose, you can consider these ones.
55
-
56
50
## Let's not argue
57
51
58
52
The editors in the lists above are those that either I or my friends who I consider good developers have been using for a long time and are happy with.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/01-hello-world/article.md
-2
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ But, we need a working environment to run our scripts, and, just because this bo
7
7
So first, let's see how to attach a script to a webpage. For server-side environments, you can just execute it with a command like `"node my.js"` for Node.JS.
8
8
9
9
10
-
[cut]
11
-
12
10
## The "script" tag
13
11
14
12
JavaScript programs can be inserted in any part of an HTML document with the help of the `<script>` tag.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/03-strict-mode/article.md
-2
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,6 @@ That had the benefit of never breaking existing code. But the downside was that
6
6
7
7
It had been so until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most modifications are off by default. One needs to enable them explicitly with a special directive `"use strict"`.
8
8
9
-
[cut]
10
-
11
9
## "use strict"
12
10
13
11
The directive looks like a string: `"use strict"` or `'use strict'`. When it is located on the top of the script, then the whole script works the "modern" way.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/04-variables/article.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Variables
2
2
3
-
Most of the time, a script needs to work with information. If it's an online-shop -- that's going to be the goods and a shopping cart. If it's a chat -- users, messages and so on.
3
+
Most of the time, a JavaScript application needs to work with information. Here are 2 examples:
4
+
1. An online-shop -- the information might include goods being sold and a shopping cart.
5
+
2. A chat application -- the information might include users, messages, and much more.
4
6
5
-
Variables are used to store the information.
6
-
7
-
[cut]
7
+
Variables are used to store this information.
8
8
9
9
## A variable
10
10
@@ -97,7 +97,7 @@ There are subtle differences between `let` and `var`, but they do not matter for
97
97
98
98
We can easily grasp the concept of a "variable" if we imagine it as a "box" for data, with a uniquely-named sticker on it.
99
99
100
-
For instance, the variable `message` can be imagined as a box labelled `"message"` with the value `"Hello!"` in it:
100
+
For instance, the variable `message` can be imagined as a box labeled `"message"` with the value `"Hello!"` in it:
101
101
102
102

103
103
@@ -296,23 +296,23 @@ Please name the variables sensibly. Take time to think if needed.
296
296
297
297
Variable naming is one of the most important and complex skills in programming. A quick glance at variable names can reveal which code is written by a beginner and which by an experienced developer.
298
298
299
-
In a real project, most of the time is spent on modifying and extending the existing code base, rather than writing something completely separate from the scratch. And when we return to the code after some time of doing something else, it's much easier to find information that is well-labelled. Or, in other words, when the variables have good names.
299
+
In a real project, most of the time is spent on modifying and extending the existing code base, rather than writing something completely separate from scratch. And when we return to the code after some time of doing something else, it's much easier to find information that is well-labeled. Or, in other words, when the variables have good names.
300
300
301
-
Please spend some time thinking about the right name for a variable before declaring it. That will repay you a lot.
301
+
Please spend some time thinking about the right name for a variable before declaring it. This will repay you a lot.
302
302
303
303
Some good-to-follow rules are:
304
304
305
305
- Use human-readable names like `userName` or `shoppingCart`.
306
306
- Stay away from abbreviations or short names like `a`, `b`, `c`, unless you really know what you're doing.
307
307
- Make the name maximally descriptive and concise. Examples of bad names are `data` and `value`. Such a name says nothing. It is only ok to use them if it's exceptionally obvious from the context which data or value is meant.
308
-
- Agree on terms within the team and in your own mind. If a site visitor is called a "user" then we should name related variables like `currentUser` or `newUser`, but not `currentVisitor` or a `newManInTown`.
308
+
- Agree on terms within your team and in your own mind. If a site visitor is called a "user" then we should name related variables like `currentUser` or `newUser`, but not `currentVisitor` or a `newManInTown`.
309
309
310
310
Sounds simple? Indeed it is, but creating good descriptive-and-concise names in practice is not. Go for it.
311
311
312
312
```smart header="Reuse or create?"
313
313
And the last note. There are some lazy programmers who, instead of declaring a new variable, tend to reuse the existing ones.
314
314
315
-
As the result, the variable is like a box where people throw different things without changing the sticker. What is inside it now? Who knows... We need to come closer and check.
315
+
As a result, the variable is like a box where people throw different things without changing the sticker. What is inside it now? Who knows... We need to come closer and check.
316
316
317
317
Such a programmer saves a little bit on variable declaration, but loses ten times more on debugging the code.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/06-type-conversions/article.md
-2
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,6 @@ For example, `alert` automatically converts any value to a string to show it. Ma
6
6
7
7
There are also cases when we need to explicitly convert a value to put things right.
8
8
9
-
[cut]
10
-
11
9
```smart header="Not talking about objects yet"
12
10
In this chapter we don't cover objects yet. Here we study primitives first. Later, after we learn objects, we'll see how object conversion works in the chapter <info:object-toprimitive>.
0 commit comments