Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
6505121
modified sub headings for clarity and to avoid confusion
ken-sawyerr Mar 27, 2019
bb159fc
Update article.md
ken-sawyerr Apr 2, 2019
52f36e4
Update article.md
smkoyan Aug 17, 2019
fed834b
Update article.md
smkoyan Aug 17, 2019
1e284b8
Update article.md
alevmo Aug 19, 2019
2af2207
Merge pull request #1245 from alevmo/patch-1
iliakan Aug 19, 2019
6cad8d5
Merge pull request #1243 from smkoyan/patch-3
iliakan Aug 19, 2019
077fd84
Merge pull request #1242 from smkoyan/patch-2
iliakan Aug 19, 2019
42603c0
minor
iliakan Aug 19, 2019
07784d8
minor
iliakan Aug 19, 2019
107fed1
Update article.md
snowcoding Aug 19, 2019
ca85093
Update article.md
snowcoding Aug 20, 2019
949bcf6
Update and rename article.md to Change 'occasional' to 'accidental' w…
paroche Aug 20, 2019
857c74f
Merge pull request #1249 from snowcoding/patch-2
iliakan Aug 20, 2019
6e2dad9
Merge pull request #1248 from snowcoding/patch-1
iliakan Aug 20, 2019
a38ab40
Merge pull request #1250 from paroche/patch-1
iliakan Aug 20, 2019
2ad0ff1
Third argument from JSON.stringify is "space".
pascal-bourut Aug 20, 2019
6b9138c
Change "occasionally" to "accidentally"
paroche Aug 20, 2019
71567d9
in task, change "occasionally" to "accidentally"
paroche Aug 20, 2019
3d4a5cc
Update article.md
paroche Aug 20, 2019
5a3a465
Change "occasionally" to "accidentally"
paroche Aug 20, 2019
05368ce
Update article.md
atimidguy Aug 21, 2019
286eef7
Merge pull request #1253 from paroche/patch-2
iliakan Aug 21, 2019
90e65b4
Merge pull request #1252 from pascal-bourut/patch-1
iliakan Aug 21, 2019
ed2fc73
Merge pull request #1254 from paroche/patch-3
iliakan Aug 21, 2019
dd3aede
Merge pull request #1255 from paroche/patch-4
iliakan Aug 21, 2019
c109e35
Merge pull request #1256 from paroche/patch-5
iliakan Aug 21, 2019
192c411
Merge pull request #1258 from atimidguy/atimidguy-patch-1
iliakan Aug 21, 2019
a645a24
minor
Violet-Bora-Lee Aug 21, 2019
047ebc8
Merge pull request #1259 from Violet-Bora-Lee/patch-24
iliakan Aug 21, 2019
3ed1024
minor
iliakan Aug 21, 2019
ef06f59
minor
iliakan Aug 21, 2019
8f75cf1
fixes
iliakan Aug 21, 2019
bd752f5
Update article.md
Violet-Bora-Lee Aug 21, 2019
8e995db
Merge pull request #1260 from Violet-Bora-Lee/patch-25
iliakan Aug 21, 2019
36cc486
Update article.md
snowcoding Aug 22, 2019
e120931
Fixed a small typo.
ashnaanasir Aug 22, 2019
db16de1
fix typo "allso"
ikeq Aug 22, 2019
a7bec7d
Merge pull request #1264 from ikeq/patch-1
iliakan Aug 22, 2019
7f2b388
Merge pull request #1263 from ayeshanasir/Update
iliakan Aug 22, 2019
23d5a0a
Merge pull request #1262 from snowcoding/patch-3
iliakan Aug 22, 2019
8c30654
fix
iliakan Aug 22, 2019
849d7a3
Update task.md
snowcoding Aug 22, 2019
78a6ffa
Update article.md
paroche Aug 23, 2019
d3b5889
Update article.md
paroche Aug 24, 2019
a736f71
Update article.md
paroche Aug 25, 2019
812daa9
Fix typo
rizkyzhang Aug 26, 2019
300338a
Merge pull request #1273 from James868/patch-1
iliakan Aug 26, 2019
dc9bcd7
Merge pull request #1272 from paroche/patch-8
iliakan Aug 26, 2019
f8f402b
Merge pull request #1269 from paroche/patch-7
iliakan Aug 26, 2019
c048701
Merge pull request #1268 from paroche/patch-6
iliakan Aug 26, 2019
745fff5
Merge pull request #1266 from snowcoding/patch-4
iliakan Aug 26, 2019
af16c20
minor
iliakan Aug 27, 2019
6637d0c
Merge branch 'master' of https://github.com/iliakan/javascript-tutori…
iliakan Aug 27, 2019
5c8d24a
closes #1271
iliakan Aug 27, 2019
2d3f7cc
minor
iliakan Aug 27, 2019
7b7fdca
clarify type conversion headings
MichaelGellings Aug 27, 2019
4d30548
Merge pull request #1279 from theBearWhoCodes/terminology
iliakan Aug 27, 2019
a301935
minor
cluah2 Aug 27, 2019
bf230df
improve description
cluah2 Aug 27, 2019
3b96e25
Update article.md
paroche Aug 28, 2019
b218b18
fixes #1261
iliakan Aug 28, 2019
5062d3f
Merge pull request #1284 from paroche/patch-8
iliakan Aug 28, 2019
85cb006
Merge pull request #1281 from cluah/patch-2
iliakan Aug 28, 2019
2b14644
Merge pull request #1280 from cluah/patch-1
iliakan Aug 28, 2019
dbc67c6
Fix typo
jessepeterman Aug 28, 2019
f682b12
Typo/grammar fix
gergoabraham Aug 28, 2019
203562b
fixed missing pronoun 'it'
atimidguy Aug 28, 2019
a750d6f
fixed missing pronoun 'it'
atimidguy Aug 28, 2019
e3cb02f
Update article.md
atimidguy Aug 28, 2019
a3c7eed
Merge branch 'master' into atimidguy-patch-2
atimidguy Aug 28, 2019
c598888
Merge pull request #2 from atimidguy/atimidguy-patch-2
atimidguy Aug 28, 2019
990cc40
Update article.md
atimidguy Aug 28, 2019
60a64a9
Merge pull request #1288 from atimidguy/master
iliakan Aug 28, 2019
fdcdc12
Merge pull request #1287 from gergooo/master
iliakan Aug 28, 2019
9f010c6
Merge pull request #1285 from jessepeterman/patch-1
iliakan Aug 28, 2019
8b5693d
Fixed spelling error
Raggan Aug 28, 2019
df3260a
fixes
iliakan Aug 29, 2019
95597b8
Merge pull request #1289 from Raggan/Raggan-patch-1
iliakan Aug 29, 2019
6fc41ba
minor
Violet-Bora-Lee Aug 29, 2019
8aca352
Update article.md
paroche Aug 30, 2019
bfeb7a4
typo
Violet-Bora-Lee Aug 30, 2019
f643be3
minor
iliakan Aug 30, 2019
69c7961
Merge pull request #1296 from Violet-Bora-Lee/patch-28
iliakan Aug 30, 2019
4ed5a0d
Merge pull request #1293 from paroche/patch-9
iliakan Aug 30, 2019
b0d39f8
Merge pull request #1292 from Violet-Bora-Lee/patch-26
iliakan Aug 30, 2019
e9ded79
fixes
iliakan Aug 30, 2019
6328c5c
fix minor English language issues
MichaelGellings Aug 30, 2019
13b70ad
fix typo
MichaelGellings Aug 31, 2019
fa3c9c5
Some minor corrections
Jandoria Aug 31, 2019
dc46fa8
Is it
Jandoria Aug 31, 2019
ace9460
Update article.md
paroche Sep 1, 2019
43c66e5
Merge pull request #1 from javascript-tutorial/master
DouglasMV Sep 1, 2019
7556bda
Typo
DouglasMV Sep 1, 2019
3d797b2
Merge pull request #1302 from DouglasMV/master
iliakan Sep 1, 2019
bbdb520
Merge pull request #1301 from paroche/patch-9
iliakan Sep 1, 2019
c4d1987
Merge pull request #1300 from Jandoria/patch-2
iliakan Sep 1, 2019
738e9b1
there must be exactly the origin there.
Jandoria Sep 1, 2019
e3cec3b
Fixed a typo
DouglasMV Sep 1, 2019
25bf9f5
Update article.md
paroche Sep 1, 2019
d27e96c
Update article.md
paroche Sep 2, 2019
6292469
Update article.md
paroche Sep 2, 2019
bcae3c6
Update article.md
paroche Sep 2, 2019
dbfe588
Merge pull request #1307 from paroche/patch-13
iliakan Sep 2, 2019
33c4149
Merge pull request #1306 from paroche/patch-12
iliakan Sep 2, 2019
4d80823
Merge pull request #1305 from paroche/patch-9
iliakan Sep 2, 2019
5f540e7
minor
iliakan Sep 2, 2019
a6a75f3
Merge pull request #1304 from DouglasMV/fixes
iliakan Sep 2, 2019
0110927
fixes
iliakan Sep 2, 2019
dfc0c75
grammar fix
atimidguy Sep 2, 2019
4723afd
minor
iliakan Sep 2, 2019
53e5139
minor
iliakan Sep 2, 2019
c6b8c25
minor
iliakan Sep 2, 2019
2f9221f
minor
iliakan Sep 2, 2019
93316a4
minor
iliakan Sep 2, 2019
07319c7
minor
iliakan Sep 2, 2019
89ff13f
minor
iliakan Sep 2, 2019
1efa9c7
Merge pull request #1311 from atimidguy/master
iliakan Sep 2, 2019
427fbea
minor
iliakan Sep 2, 2019
fa83639
Merge pull request #1298 from theBearWhoCodes/style
iliakan Sep 2, 2019
be1746d
Merge pull request #1299 from Jandoria/patch-1
iliakan Sep 2, 2019
a30e464
Merge branch 'master' into master
iliakan Sep 2, 2019
cc50d03
Merge pull request #875 from sawyerrken/master
iliakan Sep 2, 2019
6dd2798
closes #1310
iliakan Sep 2, 2019
e8091b1
closes #1309
iliakan Sep 2, 2019
08a9560
closes #1309
iliakan Sep 2, 2019
15f8b88
closes #1309
iliakan Sep 2, 2019
c01347a
minor
iliakan Sep 2, 2019
b2cedf7
closes #1308
iliakan Sep 2, 2019
ade541b
closes #1294
iliakan Sep 2, 2019
0a81213
Fix typo in Proxy and Reflect article
galacemiguel Sep 2, 2019
cdde99f
Update task.md
paroche Sep 3, 2019
b5b86f4
Merge pull request #1313 from paroche/patch-14
iliakan Sep 3, 2019
415067e
Merge pull request #1312 from galacemiguel/patch-1
iliakan Sep 3, 2019
ef370b6
closes #1220
iliakan Sep 3, 2019
01c531b
Update MDN docs link for tagged templates
scott-ln Sep 3, 2019
1f96967
Update article.md
paroche Sep 3, 2019
b86334d
Merge pull request #1314 from scottmartin-ln/patch-1
iliakan Sep 4, 2019
f8c561c
an -> a
pimonenkov Sep 4, 2019
64622ab
an -> a (#1317)
lex111 Sep 4, 2019
f21cb0a
WIP
iliakan Sep 4, 2019
0a7e953
fixes #1316
iliakan Sep 4, 2019
8c1129f
closes #1318
iliakan Sep 4, 2019
1733ef9
Merge pull request #1315 from paroche/patch-23
iliakan Sep 4, 2019
235a2ed
minor
iliakan Sep 4, 2019
f84bd8d
minor
iliakan Sep 4, 2019
fc0b185
WIP
iliakan Sep 4, 2019
2054757
WIP
iliakan Sep 5, 2019
681cae4
regexp
iliakan Sep 5, 2019
4232a53
WIP
iliakan Sep 6, 2019
32e20fc
reg->regexp
iliakan Sep 6, 2019
b5f17b4
WIP
iliakan Sep 6, 2019
9869922
Merge branch 'regexp2'
iliakan Sep 6, 2019
bec7821
Typo fix
vavlza Sep 6, 2019
7384c9a
Merge pull request #1319 from va-z/patch-2
iliakan Sep 6, 2019
cdc480a
minor
iliakan Sep 6, 2019
80ea234
form
iliakan Sep 6, 2019
1a6c1bb
Typo fix
shembel Sep 7, 2019
c738e37
fixes
iliakan Sep 7, 2019
a072018
fixes
iliakan Sep 7, 2019
3df6388
Merge pull request #1320 from shembel/Typo_in_proxy_article
lex111 Sep 7, 2019
a260bae
fix
iliakan Sep 7, 2019
d813adf
Fix minor grammatical errors
daniel-schroeder-dev Sep 7, 2019
5c7ba26
Merge pull request #2 from Dayun123/Dayun123-javascript.info--ch.4-gr…
daniel-schroeder-dev Sep 7, 2019
d0c3c69
Minor grammatical fixes
daniel-schroeder-dev Sep 7, 2019
1268643
Merge pull request #1322 from Dayun123/Dayun123-javascript.info--ch.4…
iliakan Sep 7, 2019
3dd8ca0
minor
iliakan Sep 7, 2019
cccfbd7
Update h to H char according ASCII value
HirenTariwala Sep 10, 2019
ac2a76a
Merge pull request #1326 from HirenTariwala/patch-1
iliakan Sep 10, 2019
d6ef24f
closes #1327
iliakan Sep 10, 2019
aad6d58
minor
Violet-Bora-Lee Sep 10, 2019
beed7d3
Merge pull request #1328 from Violet-Bora-Lee/patch-30
iliakan Sep 11, 2019
3da7f48
minor
iliakan Sep 11, 2019
0c2b365
Minor grammar fix
scott-ln Sep 11, 2019
a6de544
Minor grammar fix
scott-ln Sep 11, 2019
44c6ce8
Typo fix
scott-ln Sep 12, 2019
680d49e
Merge pull request #1331 from scottmartin-ln/patch-3
iliakan Sep 12, 2019
30314f6
Update article.md
paroche Sep 12, 2019
a95a2f5
Update solution.md
paroche Sep 12, 2019
4d139e9
Update article.md
paroche Sep 13, 2019
cd06cfb
Typo fix
scott-ln Sep 13, 2019
b01a5ed
Minor grammar fix
hydRAnger Sep 13, 2019
495e20c
Merge pull request #1336 from hydRAnger/patch-1
iliakan Sep 13, 2019
679a6fb
Merge pull request #1335 from scottmartin-ln/patch-4
iliakan Sep 13, 2019
455e69d
Merge pull request #1333 from paroche/patch-27
iliakan Sep 13, 2019
13bae5d
Merge pull request #1332 from paroche/patch-24
iliakan Sep 13, 2019
9fdad7a
Merge pull request #1330 from scottmartin-ln/patch-2
iliakan Sep 13, 2019
2a18661
Merge pull request #1329 from scottmartin-ln/patch-1
iliakan Sep 13, 2019
f97b2fd
Merge pull request #1334 from paroche/patch-28
iliakan Sep 13, 2019
940a9b7
Update article.md
paroche Sep 13, 2019
5138c58
Update article.md
paroche Sep 13, 2019
51d2d3e
Update solution.md
paroche Sep 13, 2019
7886e24
Update task.md
paroche Sep 14, 2019
eda9512
Update article.md
paroche Sep 14, 2019
a7d8fc3
Merge pull request #1344 from paroche/patch-35
iliakan Sep 14, 2019
cf19e84
Merge pull request #1342 from paroche/patch-33
iliakan Sep 14, 2019
478c321
Merge pull request #1341 from paroche/patch-32
iliakan Sep 14, 2019
42244df
Merge pull request #1339 from paroche/patch-29
iliakan Sep 14, 2019
c4b1a40
Merge pull request #1340 from paroche/patch-31
iliakan Sep 14, 2019
723514f
Corrected typos
KamenKolev Sep 14, 2019
6e485cd
Update article.md
paroche Sep 14, 2019
1a13738
Merge pull request #1347 from paroche/patch-29
iliakan Sep 15, 2019
646989d
Merge pull request #1346 from KamenKolev/patch-1
iliakan Sep 15, 2019
19108b3
Update article.md
paroche Sep 16, 2019
5fd9963
Update article.md
paroche Sep 16, 2019
611c0fa
Update article.md
pjsilvestre Sep 16, 2019
18e1d88
Various minor grammar fixes and improvements
scott-ln Sep 16, 2019
9fd6995
Fix typo
Violet-Bora-Lee Sep 16, 2019
49bc62e
Fix typo
Violet-Bora-Lee Sep 16, 2019
087d09a
Fix typo
Violet-Bora-Lee Sep 17, 2019
a477fff
Update article.md
paroche Sep 17, 2019
22ca59e
Update article.md
paroche Sep 18, 2019
f64f038
Update article.md
paroche Sep 18, 2019
1d2fe95
Update article.md
paroche Sep 18, 2019
172d3df
Update article.md
paroche Sep 18, 2019
d7f9665
Update article.md
paroche Sep 18, 2019
fc6f37d
Merge pull request #1361 from paroche/patch-46
iliakan Sep 18, 2019
851acfc
Merge pull request #1360 from paroche/patch-44
iliakan Sep 18, 2019
adf7fb4
Merge branch 'master' into patch-43
iliakan Sep 18, 2019
13bef41
Merge pull request #1359 from paroche/patch-43
iliakan Sep 18, 2019
a7b5030
Merge pull request #1358 from paroche/patch-42
iliakan Sep 18, 2019
ce344e7
Merge pull request #1356 from paroche/patch-40
iliakan Sep 18, 2019
9f3178b
Merge pull request #1355 from paroche/patch-39
iliakan Sep 18, 2019
be9a339
Merge pull request #1354 from Violet-Bora-Lee/patch-35
iliakan Sep 18, 2019
007af4f
Merge pull request #1353 from Violet-Bora-Lee/patch-34
iliakan Sep 18, 2019
6c83d45
Merge pull request #1352 from Violet-Bora-Lee/patch-33
iliakan Sep 18, 2019
2294306
Merge pull request #1351 from scott-ln/patch-1
iliakan Sep 18, 2019
7e9f902
Merge pull request #1350 from pjsilvestre/patch-1
iliakan Sep 18, 2019
119fadf
Merge pull request #1349 from paroche/patch-37
iliakan Sep 18, 2019
4745f44
Merge pull request #1348 from paroche/patch-31
iliakan Sep 18, 2019
fd4d2f0
Fix extending of class
jat-odoo Sep 19, 2019
f80dc03
Fix extending of class (#1363)
lex111 Sep 19, 2019
77dc1ba
fix
iliakan Sep 21, 2019
75577f9
fix
iliakan Sep 21, 2019
c3ef6c0
fix
iliakan Sep 21, 2019
29771d9
Update article.md
paroche Sep 22, 2019
b9a7bfc
Update solution.md
paroche Sep 22, 2019
8d52459
Merge pull request #1365 from paroche/patch-37
iliakan Sep 22, 2019
ebc2d62
Merge pull request #1366 from paroche/patch-39
iliakan Sep 22, 2019
1360bf9
Update article.md
Sep 22, 2019
2b5c975
Merge pull request #1367 from fires3as0n/patch-1
iliakan Sep 22, 2019
4d65431
fix
iliakan Sep 22, 2019
b373e69
merging all conflicts
iliakan Sep 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions 1-js/01-getting-started/2-manuals-specifications/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ Această carte este un *tutorial*. Are ca obiectiv să te ajute să înveți tre

## Specificații

<<<<<<< HEAD
**Specificația ECMA-262** conține cea mai în profunzime, detaliată și formalizată informație despre JavaScript. Aceasta definește limbajul.
=======
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
>>>>>>> 4d654318ccb6d37d6cefc9b859cf111ff3c96b27

Dar fiind atât de formalizată, este grea de înțeles la început. Deci dacă ai nevoie de cea mai de încredere sursă de informație despre detaliile limbajului, specificațiile sunt locul potrivit. Dar nu sunt pentru uzul obișnuit.

<<<<<<< HEAD
Ultima schiță este la <https://tc39.es/ecma262/>.
=======
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
>>>>>>> 4d654318ccb6d37d6cefc9b859cf111ff3c96b27

Pentru a citi despre noile caracteristici avansate, incluzând acelea care sunt "aproape standard" (așa-numita "etapă a treia"), vezi propunerile la <https://github.com/tc39/proposals>.

Expand Down
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A [variable](https://en.wikipedia.org/wiki/Variable_(computer_science)) is a "na

To create a variable in JavaScript, use the `let` keyword.

The statement below creates (in other words: *declares* or *defines*) a variable with the name "message":
The statement below creates (in other words: *declares*) a variable with the name "message":

```js
let message;
Expand Down Expand Up @@ -290,7 +290,7 @@ In other words, capital-named constants are only used as aliases for "hard-coded

Talking about variables, there's one more extremely important thing.

A variable name should have a clean, obvious meaning, describe the data that it stores.
A variable name should have a clean, obvious meaning, describing the data that it stores.

Variable naming is one of the most important and complex skills in programming. A quick glance at variable names can reveal which code was written by a beginner versus an experienced developer.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ true + false = 1
" -9 " - 5 = -14 // (4)
null + 1 = 1 // (5)
undefined + 1 = NaN // (6)
" \t \n" - 2 = -2 // (7)
```

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.
Expand All @@ -22,3 +23,4 @@ undefined + 1 = NaN // (6)
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
5. `null` becomes `0` after the numeric conversion.
6. `undefined` becomes `NaN` after the numeric conversion.
7. Space characters, are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n` and a "regular" space between them. So, similarly to an empty string, it becomes `0`.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ true + false
" -9 " - 5
null + 1
undefined + 1
" \t \n" - 2
```

Think well, write down and then compare with the answer.
13 changes: 6 additions & 7 deletions 1-js/02-first-steps/06-type-conversions/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There are also cases when we need to explicitly convert a value to the expected
In this chapter, we won't cover objects. Instead, we'll study primitives first. Later, after we learn about objects, we'll see how object conversion works in the chapter <info:object-toprimitive>.
```

## ToString
## String Conversion

String conversion happens when we need the string form of a value.

Expand All @@ -30,7 +30,7 @@ alert(typeof value); // string

String conversion is mostly obvious. A `false` becomes `"false"`, `null` becomes `"null"`, etc.

## ToNumber
## Numeric Conversion

Numeric conversion happens in mathematical functions and expressions automatically.

Expand Down Expand Up @@ -94,7 +94,7 @@ alert( '1' + 2 ); // '12' (string to the left)
This only happens when at least one of the arguments is a string. Otherwise, values are converted to numbers.
````

## ToBoolean
## Boolean Conversion

Boolean conversion is the simplest one.

Expand Down Expand Up @@ -124,14 +124,13 @@ alert( Boolean(" ") ); // spaces, also true (any non-empty string is true)
```
````


## Summary

The three most widely used type conversions are to string, to number, and to boolean.

**`ToString`** -- Occurs when we output something. Can be performed with `String(value)`. The conversion to string is usually obvious for primitive values.
**`String Conversion`** -- Occurs when we output something. Can be performed with `String(value)`. The conversion to string is usually obvious for primitive values.

**`ToNumber`** -- Occurs in math operations. Can be performed with `Number(value)`.
**`Numeric Conversion`** -- Occurs in math operations. Can be performed with `Number(value)`.

The conversion follows the rules:

Expand All @@ -142,7 +141,7 @@ The conversion follows the rules:
|<code>true&nbsp;/&nbsp;false</code> | `1 / 0` |
| `string` | The string is read "as is", whitespaces from both sides are ignored. An empty string becomes `0`. An error gives `NaN`. |

**`ToBoolean`** -- Occurs in logical operations. Can be performed with `Boolean(value)`.
**`Boolean Conversion`** -- Occurs in logical operations. Can be performed with `Boolean(value)`.

Follows the rules:

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/07-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Before we move on, let's grasp some common terminology.
alert( y - x ); // 2, binary minus subtracts values
```

Formally, we're talking about two different operators here: the unary negation (single operand: reverses the sign) and the binary subtraction (two operands: subtracts).
Formally, in the examples above we have two different operators that share the same symbol: the negation operator, a unary operator that reverses the sign, and the subtraction operator, a binary operator that subtracts one number from another.

## String concatenation, binary +

Expand Down
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/12-while-for/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ Let's examine the `for` statement part-by-part:
|-------|----------|----------------------------------------------------------------------------|
| begin | `i = 0` | Executes once upon entering the loop. |
| condition | `i < 3`| Checked before every loop iteration. If false, the loop stops. |
| step| `i++` | Executes after the body on each iteration but before the condition check. |
| body | `alert(i)`| Runs again and again while the condition is truthy. |
| step| `i++` | Executes after the body on each iteration. |

The general loop algorithm works like this:

Expand Down Expand Up @@ -300,7 +300,7 @@ This is just another reason not to use the question mark operator `?` instead of

Sometimes we need to break out from multiple nested loops at once.

For example, in the code below we loop over `i` and `j`, prompting for the coordinates `(i, j)` from `(0,0)` to `(3,3)`:
For example, in the code below we loop over `i` and `j`, prompting for the coordinates `(i, j)` from `(0,0)` to `(2,2)`:

```js run no-beautify
for (let i = 0; i < 3; i++) {
Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/16-javascript-specials/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Conditional
: The only operator with three parameters: `cond ? resultA : resultB`. If `cond` is truthy, returns `resultA`, otherwise `resultB`.

Logical operators
: Logical AND `&&` and OR `||` perform short-circuit evaluation and then return the value where it stopped. Logical NOT `!` converts the operand to boolean type and returns the inverse value.
: Logical AND `&&` and OR `||` perform short-circuit evaluation and then return the value where it stopped (not necessary `true`/`false`). Logical NOT `!` converts the operand to boolean type and returns the inverse value.

Comparisons
: Equality check `==` for values of different types converts them to a number (except `null` and `undefined` that equal each other and nothing else), so these are equal:
Expand Down
2 changes: 1 addition & 1 deletion 1-js/03-code-quality/01-debugging-chrome/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before writing more complex code, let's talk about debugging.

[Debugging](https://en.wikipedia.org/wiki/Debugging) is the process of finding and fixing errors within a script. All modern browsers and most other environments support debugging tools -- a special UI in developer tools that enable debugging much easier. It also allows to trace the code step by step to see what exactly is going on.
[Debugging](https://en.wikipedia.org/wiki/Debugging) is the process of finding and fixing errors within a script. All modern browsers and most other environments support debugging tools -- a special UI in developer tools that makes debugging much easier. It also allows to trace the code step by step to see what exactly is going on.

We'll be using Chrome here, because it has enough features, most other browsers have a similar process`.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/03-code-quality/02-coding-style/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let n = prompt("n?", "");

if (n < 0) {
alert(`Power ${n} is not supported,
please enter an integer number, greater than 0`);
please enter a non-negative integer number`);
} else {
alert( pow(x, n) );
}
Expand Down
5 changes: 5 additions & 0 deletions 1-js/03-code-quality/03-comments/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ Comentariile bune ne permit să păstrăm codul organizat, să ne întoarcem la

**Evită comentariile pentru:**

<<<<<<< HEAD
- Pentru a descrie "cum funcționează codul" și "ce face".
- Folosește-le doar dacă este imposibil să faci codul atât de simplu și autodescriptiv încât comentariile să nu mai fie necesare.
=======
- That tell "how code works" and "what it does".
- Put them in only if it's impossible to make the code so simple and self-descriptive that it doesn't require them.
>>>>>>> 4d654318ccb6d37d6cefc9b859cf111ff3c96b27

Comentariile sunt de asemenea folosite pentru unelte de autodocumentare precum JSDoc3: acestea le citesc și generează documentații HTML (sau documentații în alt format).
2 changes: 1 addition & 1 deletion 1-js/03-code-quality/05-testing-mocha/article.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automated testing with mocha
# Automated testing with Mocha

Automated testing will be used in further tasks, and it's also widely used in real projects.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/03-code-quality/06-polyfills/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here Babel comes to the rescue.

Actually, there are two parts in Babel:

1. First, the transpiler program, which rewrites the code. The developer runs it on their own computer. It rewrites the code into the older standard. And then the code is delivered to the website for users. Modern project build system like [webpack](http://webpack.github.io/) provide means to run transpiler automatically on every code change, so that very easy to integrate into development process.
1. First, the transpiler program, which rewrites the code. The developer runs it on their own computer. It rewrites the code into the older standard. And then the code is delivered to the website for users. Modern project build systems like [webpack](http://webpack.github.io/) provide means to run transpiler automatically on every code change, so that very easy to integrate into development process.

2. Second, the polyfill.

Expand Down
8 changes: 4 additions & 4 deletions 1-js/04-object-basics/03-symbol/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ alert(id); // TypeError: Cannot convert a Symbol value to a string
*/!*
```

That's a "language guard" against messing up, because strings and symbols are fundamentally different and should not occasionally convert one into another.
That's a "language guard" against messing up, because strings and symbols are fundamentally different and should not accidentally convert one into another.

If we really want to show a symbol, we need to explicitly call `.toString()` on it, like here:
```js run
Expand All @@ -72,7 +72,7 @@ alert(id.description); // id

## "Hidden" properties

Symbols allow us to create "hidden" properties of an object, that no other part of code can occasionally access or overwrite.
Symbols allow us to create "hidden" properties of an object, that no other part of code can accidentally access or overwrite.

For instance, if we're working with `user` objects, that belong to a third-party code. We'd like to add identifiers to them.

Expand All @@ -92,7 +92,7 @@ alert( user[id] ); // we can access the data using the symbol as the key

What's the benefit of using `Symbol("id")` over a string `"id"`?

As `user` objects belongs to another code, and that code also works with them, we shouldn't just add any fields to it. That's unsafe. But a symbol cannot be accessed occasionally, the third-party code probably won't even see it, so it's probably all right to do.
As `user` objects belongs to another code, and that code also works with them, we shouldn't just add any fields to it. That's unsafe. But a symbol cannot be accessed accidentally, the third-party code probably won't even see it, so it's probably all right to do.

Also, imagine that another script wants to have its own identifier inside `user`, for its own purposes. That may be another JavaScript library, so that the scripts are completely unaware of each other.

Expand Down Expand Up @@ -284,7 +284,7 @@ Symbols are always different values, even if they have the same name. If we want
Symbols have two main use cases:

1. "Hidden" object properties.
If we want to add a property into an object that "belongs" to another script or a library, we can create a symbol and use it as a property key. A symbolic property does not appear in `for..in`, so it won't be occasionally processed together with other properties. Also it won't be accessed directly, because another script does not have our symbol. So the property will be protected from occasional use or overwrite.
If we want to add a property into an object that "belongs" to another script or a library, we can create a symbol and use it as a property key. A symbolic property does not appear in `for..in`, so it won't be accidentally processed together with other properties. Also it won't be accessed directly, because another script does not have our symbol. So the property will be protected from accidental use or overwrite.

So we can "covertly" hide something into objects that we need, but others should not see, using symbolic properties.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let user = {
(user.go)() // error!
```

The error message in most browsers does not give understanding what went wrong.
The error message in most browsers does not give us much of a clue about what went wrong.

**The error appears because a semicolon is missing after `user = {...}`.**

Expand Down
16 changes: 8 additions & 8 deletions 1-js/04-object-basics/04-object-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ user.sayHi(); // Hello!
```

```smart header="Object-oriented programming"
When we write our code using objects to represent entities, that's called an [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming), in short: "OOP".
When we write our code using objects to represent entities, that's called [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming), in short: "OOP".

OOP is a big thing, an interesting science of its own. How to choose the right entities? How to organize the interaction between them? That's architecture, and there are great books on that topic, like "Design Patterns: Elements of Reusable Object-Oriented Software" by E.Gamma, R.Helm, R.Johnson, J.Vissides or "Object-Oriented Analysis and Design with Applications" by G.Booch, and more.
```
Expand Down Expand Up @@ -98,7 +98,7 @@ It's common that an object method needs to access the information stored in the

For instance, the code inside `user.sayHi()` may need the name of the `user`.

**To access the object, a method can use the `this` keyword.**
**To access the object, a method can use `this` keyword.**

The value of `this` is the object "before dot", the one used to call the method.

Expand Down Expand Up @@ -167,9 +167,9 @@ If we used `this.name` instead of `user.name` inside the `alert`, then the code

## "this" is not bound

In JavaScript, "this" keyword behaves unlike most other programming languages. It can be used in any function.
In JavaScript, keyword `this` behaves unlike most other programming languages. It can be used in any function.

There's no syntax error in the code like that:
There's no syntax error in the following example:

```js
function sayHi() {
Expand Down Expand Up @@ -220,17 +220,17 @@ In this case `this` is `undefined` in strict mode. If we try to access `this.nam

In non-strict mode the value of `this` in such case will be the *global object* (`window` in a browser, we'll get to it later in the chapter [](info:global-object)). This is a historical behavior that `"use strict"` fixes.

Usually such call is an programming error. If there's `this` inside a function, it expects to be called in an object context.
Usually such call is a programming error. If there's `this` inside a function, it expects to be called in an object context.
````

```smart header="The consequences of unbound `this`"
If you come from another programming language, then you are probably used to the idea of a "bound `this`", where methods defined in an object always have `this` referencing that object.

In JavaScript `this` is "free", its value is evaluated at call-time and does not depend on where the method was declared, but rather on what's the object "before the dot".
In JavaScript `this` is "free", its value is evaluated at call-time and does not depend on where the method was declared, but rather on what object is "before the dot".

The concept of run-time evaluated `this` has both pluses and minuses. On the one hand, a function can be reused for different objects. On the other hand, greater flexibility opens a place for mistakes.
The concept of run-time evaluated `this` has both pluses and minuses. On the one hand, a function can be reused for different objects. On the other hand, the greater flexibility creates more possibilities for mistakes.

Here our position is not to judge whether this language design decision is good or bad. We'll understand how to work with it, how to get benefits and evade problems.
Here our position is not to judge whether this language design decision is good or bad. We'll understand how to work with it, how to get benefits and avoid problems.
```

## Internals: Reference Type
Expand Down
2 changes: 1 addition & 1 deletion 1-js/04-object-basics/05-object-toprimitive/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ For instance:
}
};

alert(obj + 2); // 22 (ToPrimitive returned string => concatenation)
alert(obj + 2); // 22 (conversion to primitive returned a string => concatenation)
```

## Summary
Expand Down
15 changes: 6 additions & 9 deletions 1-js/04-object-basics/06-constructor-new/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ alert(user.name); // Jack
alert(user.isAdmin); // false
```

When a function is executed as `new User(...)`, it does the following steps:
When a function is executed with `new`, it does the following steps:

1. A new empty object is created and assigned to `this`.
2. The function body executes. Usually it modifies `this`, adds new properties to it.
Expand All @@ -51,7 +51,7 @@ function User(name) {
}
```

So the result of `new User("Jack")` is the same object as:
So `let user = new User("Jack")` gives the same result as:

```js
let user = {
Expand Down Expand Up @@ -136,7 +136,7 @@ Usually, constructors do not have a `return` statement. Their task is to write a

But if there is a `return` statement, then the rule is simple:

- If `return` is called with object, then it is returned instead of `this`.
- If `return` is called with an object, then the object is returned instead of `this`.
- If `return` is called with a primitive, it's ignored.

In other words, `return` with an object returns that object, in all other cases `this` is returned.
Expand All @@ -148,10 +148,10 @@ function BigUser() {

this.name = "John";

return { name: "Godzilla" }; // <-- returns an object
return { name: "Godzilla" }; // <-- returns this object
}

alert( new BigUser().name ); // Godzilla, got that object ^^
alert( new BigUser().name ); // Godzilla, got that object
```

And here's an example with an empty `return` (or we could place a primitive after it, doesn't matter):
Expand All @@ -161,10 +161,7 @@ function SmallUser() {

this.name = "John";

return; // finishes the execution, returns this

// ...

return; // <-- returns this
}

alert( new SmallUser().name ); // John
Expand Down
Loading