Skip to content

Commit 720b328

Browse files
authored
Merge pull request #1 from iliakan/master
Repo Update 31-Jul-2018
2 parents 2b57bda + ded121f commit 720b328

File tree

211 files changed

+1322
-1355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+1322
-1355
lines changed

Diff for: 1-js/01-getting-started/1-intro/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ The browser has an embedded engine, sometimes it's also called a "JavaScript vir
2525
Different engines have different "codenames", for example:
2626

2727
- [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.
2929
- ...There are other codenames like "Trident", "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari etc.
3030

3131
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.
3232

33-
```smart header="How engines work?"
33+
```smart header="How do engines work?"
3434
3535
Engines are complicated. But the basics are easy.
3636
@@ -108,7 +108,7 @@ Modern tools make the transpilation very fast and transparent, actually allowing
108108

109109
Examples of such languages:
110110

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.
112112
- [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.
113113
- [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.
114114

Diff for: 1-js/01-getting-started/2-code-editors/article.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
# Code editors
22

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.
44

55
There are two archetypes: IDE and lightweight editors. Many people feel comfortable choosing one tool of each type.
66

7-
[cut]
8-
97
## IDE
108

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".
1210

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.
1412

1513
If you haven't considered selecting an IDE yet, look at the following variants:
1614

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.
1816
- 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).
2117
- [Netbeans](http://netbeans.org/).
2218

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.
2420

2521
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.
2622

@@ -40,19 +36,17 @@ The following options deserve your attention:
4036
- [Atom](https://atom.io/) (cross-platform, free).
4137
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
4238
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
43-
- 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.
4440

4541
## My favorites
4642

4743
The personal preference of the author is to have both an IDE for projects and a lightweight editor for quick and easy file editing.
4844

4945
I'm using:
5046

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.
5248
- As a lightweight editor -- [Sublime Text](http://www.sublimetext.com) or [Atom](https://atom.io/).
5349

54-
If you don't know what to choose, you can consider these ones.
55-
5650
## Let's not argue
5751

5852
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.

Diff for: 1-js/01-getting-started/3-devtools/article.md

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Most often developers lean towards Chrome or Firefox for development, because th
1010

1111
Developer tools are really powerful, there are many features. To start, we'll learn how to open them, look at errors and run JavaScript commands.
1212

13-
[cut]
14-
1513
## Google Chrome
1614

1715
Open the page [bug.html](bug.html).

Diff for: 1-js/02-first-steps/01-hello-world/article.md

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ But, we need a working environment to run our scripts, and, just because this bo
77
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.
88

99

10-
[cut]
11-
1210
## The "script" tag
1311

1412
JavaScript programs can be inserted in any part of an HTML document with the help of the `<script>` tag.

Diff for: 1-js/02-first-steps/02-structure/article.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
The first thing to study is the building blocks of the code.
44

5-
[cut]
6-
75
## Statements
86

97
Statements are syntax constructs and commands that perform actions.
@@ -102,7 +100,7 @@ As time goes on, the program becomes more and more complex. It becomes necessary
102100

103101
Comments can be put into any place of the script. They don't affect the execution, because the engine simply ignores them.
104102

105-
**One-line comments start with the two forward slash characters `//`.**
103+
**One-line comments start with two forward slash characters `//`.**
106104

107105
The rest of the line is a comment. It may occupy a full line of its own or follow a statement.
108106

Diff for: 1-js/02-first-steps/03-strict-mode/article.md

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ That had the benefit of never breaking existing code. But the downside was that
66

77
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"`.
88

9-
[cut]
10-
119
## "use strict"
1210

1311
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.

Diff for: 1-js/02-first-steps/04-variables/article.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Variables
22

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.
46

5-
Variables are used to store the information.
6-
7-
[cut]
7+
Variables are used to store this information.
88

99
## A variable
1010

@@ -97,7 +97,7 @@ There are subtle differences between `let` and `var`, but they do not matter for
9797
9898
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.
9999
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:
101101
102102
![](variable.png)
103103
@@ -296,23 +296,23 @@ Please name the variables sensibly. Take time to think if needed.
296296
297297
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.
298298
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.
300300
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.
302302
303303
Some good-to-follow rules are:
304304
305305
- Use human-readable names like `userName` or `shoppingCart`.
306306
- Stay away from abbreviations or short names like `a`, `b`, `c`, unless you really know what you're doing.
307307
- 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`.
309309
310310
Sounds simple? Indeed it is, but creating good descriptive-and-concise names in practice is not. Go for it.
311311
312312
```smart header="Reuse or create?"
313313
And the last note. There are some lazy programmers who, instead of declaring a new variable, tend to reuse the existing ones.
314314
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.
316316
317317
Such a programmer saves a little bit on variable declaration, but loses ten times more on debugging the code.
318318

Diff for: 1-js/02-first-steps/05-types/article.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Programming languages that allow such things are called "dynamically typed", mea
1212

1313
There are seven basic data types in JavaScript. Here we'll study the basics, and in the next chapters we'll talk about each of them in detail.
1414

15-
[cut]
16-
1715
## A number
1816

1917
```js
@@ -162,7 +160,7 @@ let x;
162160
alert(x); // shows "undefined"
163161
```
164162

165-
Technically, it is possible to assign any variable to `undefined`:
163+
Technically, it is possible to assign `undefined` to any variable:
166164

167165
```js run
168166
let x = 123;
@@ -191,7 +189,7 @@ It supports two forms of syntax:
191189
1. As an operator: `typeof x`.
192190
2. Function style: `typeof(x)`.
193191

194-
In other words, it works both with the brackets or without them. The result is the same.
192+
In other words, it works both with parentheses or without them. The result is the same.
195193

196194
The call to `typeof x` returns a string with the type name:
197195

Diff for: 1-js/02-first-steps/06-type-conversions/1-primitive-conversions-questions/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ undefined + 1 = NaN // (4)
1717
```
1818

1919
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
20-
2. The substruction `"-"` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
20+
2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
2121
3. `null` becomes `0` after the numeric conversion.
2222
4. `undefined` becomes `NaN` after the numeric conversion.

Diff for: 1-js/02-first-steps/06-type-conversions/article.md

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ For example, `alert` automatically converts any value to a string to show it. Ma
66

77
There are also cases when we need to explicitly convert a value to put things right.
88

9-
[cut]
10-
119
```smart header="Not talking about objects yet"
1210
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>.
1311
```

0 commit comments

Comments
 (0)