Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
8ab07e1
consistent error output comments
Nov 7, 2019
7b0e8ba
Update article.md
paroche Nov 8, 2019
d4c9b1a
modified a sentence
Haggr Nov 10, 2019
d43276a
Added clarification
koala-lava Nov 11, 2019
fd294ee
Add a missing word
huyenltnguyen Nov 12, 2019
9a07b1f
Fix small grammar mistake in closure makeArmy task
jakewilson Nov 12, 2019
fd70f75
add consistency
dagolinuxoid Nov 18, 2019
183d87b
Update solution.md
spaceinvadev Nov 18, 2019
0152adc
Fix: typos
kvoncode Nov 19, 2019
c7a9080
BigInt Type added in primitive types
ajitsinghkaler Nov 20, 2019
4963fce
Fix SyntaxError
neozeno Nov 20, 2019
09f2aa6
Update article.md
neozeno Nov 20, 2019
12acb05
Added new information about bigInt
ajitsinghkaler Nov 22, 2019
d883720
Fix err in syntax
Nov 23, 2019
69e1169
fixed a word 'operational' to be 'operating'
koala-lava Nov 24, 2019
fd215a4
Update article.md
generally23 Nov 24, 2019
e3fb7dd
minor
koala-lava Nov 25, 2019
7f2118b
consistent CSS for the task and the solution
koala-lava Nov 25, 2019
2ddea5d
Update article.md
dashaezhova Nov 25, 2019
51d2097
Consistent HTML for the task source and solution
koala-lava Nov 25, 2019
9f9f585
Fix: typos in <5-network/02-formdata/article.md> (#1618)
lex111 Nov 25, 2019
691c306
Fix err in syntax (#1621)
lex111 Nov 25, 2019
8512134
Update article.md (#1625)
lex111 Nov 25, 2019
a797429
fixed a word 'operational' to be 'operating' (#1624)
lex111 Nov 25, 2019
2c10460
typo (#1627)
lex111 Nov 25, 2019
03499d6
Update article.md (#1628)
lex111 Nov 25, 2019
9baeb3c
minor
koala-lava Nov 25, 2019
9c7f4cd
replace russian-english comment with english (#1630)
lex111 Nov 25, 2019
18a3b24
modified a sentence (#1601)
lex111 Nov 25, 2019
8bdd11c
Update article.md
paroche Nov 26, 2019
69c30d0
Update article.md
paroche Nov 26, 2019
c356514
Update article.md
paroche Nov 26, 2019
f073dbd
Update task.md
paroche Nov 26, 2019
b5b91fa
Update 'Window sizes and scrolling' article.md
dashaezhova Nov 26, 2019
9323cf2
Update index.html
masterashu Nov 26, 2019
4355972
Update index.html
masterashu Nov 26, 2019
fcf12e4
Update solution.md
masterashu Nov 26, 2019
6d2b959
Update task.md
masterashu Nov 26, 2019
484b24d
Update article.md
paroche Nov 27, 2019
bee5cdf
Merge pull request #1633 from javascript-tutorial/paroche-patch-11
paroche Nov 27, 2019
899d11e
Update article.md
paroche Nov 27, 2019
020dd85
Merge pull request #1634 from javascript-tutorial/paroche-patch-11
paroche Nov 27, 2019
2af7402
Fixing urls to start with 'https' (#1632)
lex111 Nov 27, 2019
8c8f3bc
Minor note
koala-lava Nov 28, 2019
ce8e68f
minor fixes
iliakan Nov 28, 2019
40e941e
minor fixes
iliakan Nov 30, 2019
4587fde
re-import images (Sketch update)
iliakan Nov 30, 2019
53b5fb2
minor
iliakan Nov 30, 2019
fcd7589
minor fixes
iliakan Nov 30, 2019
6a52ee2
Merge pull request #1637 from koala-lava/patch-3
iliakan Nov 30, 2019
d334cf8
minor fixes
iliakan Nov 30, 2019
cd27aff
Merge pull request #1631 from dashaezhova/patch-1
iliakan Nov 30, 2019
df4acb6
Merge pull request #1629 from koala-lava/patch-7
iliakan Nov 30, 2019
f8e8fd1
Merge pull request #1626 from koala-lava/patch-6
iliakan Nov 30, 2019
16e09cf
Merge pull request #1614 from spaceinvadev/master
iliakan Nov 30, 2019
9d09ada
Merge pull request #1613 from dagolinuxoid/patch-3
iliakan Nov 30, 2019
22cab45
Merge pull request #1606 from jakewilson/patch-1
iliakan Nov 30, 2019
438e66d
Merge pull request #1620 from ajitsinghkaler/BigInt
iliakan Nov 30, 2019
d0b0a4a
Merge pull request #1 from javascript-tutorial/master
neozeno Nov 30, 2019
bada753
Fix small typo in example comment
spaceinvadev Nov 30, 2019
a70c430
bigint
iliakan Dec 1, 2019
9548345
Update article.md
paroche Dec 1, 2019
790bd5c
Update article.md
paroche Dec 1, 2019
d3f2e8f
Merge pull request #1643 from spaceinvadev/small-typo-in-comment
iliakan Dec 1, 2019
7469922
Merge pull request #1604 from huyenltnguyen/huyenltnguyen-patch-1
iliakan Dec 1, 2019
d04fbf4
Merge pull request #1597 from javascript-tutorial/paroche-patch-7
iliakan Dec 1, 2019
4496439
Merge pull request #1594 from koala-lava/master
iliakan Dec 1, 2019
2189dc9
minor fixes
iliakan Dec 1, 2019
e1c9b21
content improvements
iliakan Dec 1, 2019
0de5046
Update solution.md
koala-lava Dec 1, 2019
22888ae
minor fixes
iliakan Dec 1, 2019
47d1865
Merge pull request #1603 from koala-lava/patch-2
iliakan Dec 1, 2019
0fd5806
Update article.md
CyberMew Dec 2, 2019
e62b04a
Update article.md
CyberMew Dec 2, 2019
6837f4e
Update article.md
paroche Dec 2, 2019
a169464
Update solution.md
CyberMew Dec 2, 2019
458fdff
content improvements
iliakan Dec 2, 2019
7e5f960
Merge pull request #1651 from CyberMew/patch-10
iliakan Dec 2, 2019
4dcc05d
Merge pull request #1650 from javascript-tutorial/paroche-patch-7
iliakan Dec 2, 2019
6cc9b62
Merge pull request #1647 from CyberMew/patch-8
iliakan Dec 2, 2019
09da2a9
content fixes, #1646
iliakan Dec 2, 2019
9831b86
fixes #1599
iliakan Dec 2, 2019
e144f39
fixes #1591
iliakan Dec 2, 2019
4110f00
closes #1591
iliakan Dec 3, 2019
5b19579
fixes #1653
iliakan Dec 4, 2019
5cd604d
Fix wrong answer
ogaclejapan Dec 5, 2019
2bfaf1c
"And" instead of "и"
yuanworks Dec 5, 2019
47e4689
Fix incorrect link address
Dec 6, 2019
4c650b5
Make minor grammar corrections/updates to async/promise-basics
jchue Dec 8, 2019
07ae558
Make minor grammar corrections/updates to async/promise-chaining
jchue Dec 8, 2019
375630b
Make minor grammar corrections/updates to async/promise-error-handling
jchue Dec 8, 2019
a53fb38
Make minor grammar corrections/updates to async/promise-api
jchue Dec 8, 2019
58398a6
Make minor grammar corrections/updates to async/promisify
jchue Dec 8, 2019
38f0468
Make minor grammar corrections/updates to async/microtask-queue
jchue Dec 8, 2019
bca0359
Make minor grammar corrections/updates to async/async-await
jchue Dec 8, 2019
8b68689
Update article.md
paroche Dec 9, 2019
9f2c36f
Merge pull request #1667 from javascript-tutorial/paroche-patch-12
paroche Dec 9, 2019
89bdf1d
Update article.md
paroche Dec 9, 2019
524d598
Merge pull request #1668 from javascript-tutorial/paroche-patch-12
paroche Dec 9, 2019
79bf626
Spell correction
siddtheone Dec 10, 2019
9c9e7ee
Update article.md
Aissaoui-Ahmed Dec 10, 2019
1516ce9
Added extra space
Dec 12, 2019
77af30d
Add "bigint" to primitive types
sajadhsm Dec 18, 2019
d1100fc
Update article.md
leviding Dec 18, 2019
75feb38
Update article.md
leviding Dec 18, 2019
e09a55a
Update article.md
lex111 Dec 19, 2019
8b45448
Merge pull request #1658 from LaievskyiSasha/master
lex111 Dec 19, 2019
27ff241
Merge pull request #1655 from yuanworks/patch-2-typo
lex111 Dec 19, 2019
7c793a6
Update article.md
lex111 Dec 19, 2019
213c6c6
Merge pull request #1679 from leviding/patch-1
lex111 Dec 19, 2019
fde0e1e
Merge pull request #1671 from Aissaoui-Ahmed/patch-1
lex111 Dec 19, 2019
e92bb83
Merge pull request #1670 from siddtheone/patch-1
lex111 Dec 19, 2019
9e1ef65
Update test.js
leviding Dec 20, 2019
182ac4b
Update test.js
leviding Dec 20, 2019
66a2af3
remove incorrect info about synchronous postMessage
nylki Dec 20, 2019
964ed57
closure
iliakan Dec 26, 2019
bdcc744
Merge branch 'master' of https://github.com/iliakan/javascript-tutori…
iliakan Dec 26, 2019
990b8f4
Merge pull request #1682 from nylki/patch-1
iliakan Dec 26, 2019
2aa36c1
Merge pull request #1681 from leviding/patch-1
iliakan Dec 26, 2019
e97e437
Merge pull request #1678 from sajadhsm/patch-1
iliakan Dec 26, 2019
17e8fb6
fixes #1673
iliakan Dec 26, 2019
b015213
minor fixes
iliakan Dec 26, 2019
50395ec
minor fixes
iliakan Dec 26, 2019
ac666de
fiexes
KennethKinLum Dec 26, 2019
3591df7
fix run-on sentence
KennethKinLum Dec 26, 2019
8d6a718
Fix incorrect method call to querySelector
ogaclejapan Dec 26, 2019
ed03f70
Renew link for polyfill about webcomponentsjs
ogaclejapan Dec 26, 2019
272c487
Merge pull request #1692 from ogaclejapan/renew-link-polyfill-webcomp…
iliakan Dec 27, 2019
e14dcd3
Merge pull request #1691 from ogaclejapan/fix-incorrect-method-call
iliakan Dec 27, 2019
461ea30
closes #1689
iliakan Dec 27, 2019
0716a85
Merge pull request #1688 from KennethKinLum/patch-1
iliakan Dec 27, 2019
2483af0
Merge pull request #1654 from ogaclejapan/fix-open-flags
iliakan Dec 27, 2019
9943902
fixes #1669
iliakan Dec 27, 2019
9236ab3
Merge pull request #1690 from KennethKinLum/patch-4
iliakan Dec 27, 2019
94c6f0b
Merge pull request #1662 from jchue/patch-4
iliakan Dec 27, 2019
7002488
Merge pull request #1663 from jchue/patch-5
iliakan Dec 27, 2019
e3a2051
fix typo
nonopolarity Dec 27, 2019
506567b
Fix typo
charliewxyz Dec 27, 2019
fd4f737
reduce improvement
iliakan Dec 27, 2019
6be43b1
Merge pull request #1664 from jchue/patch-6
paroche Dec 27, 2019
c2a9c2d
closure task
iliakan Dec 28, 2019
87a7232
Merge pull request #1698 from karniol/patch-1
lex111 Dec 29, 2019
28ed5a3
Merge pull request #1697 from jianlin/patch-1
lex111 Dec 29, 2019
c77de52
Fixed typo in article.md
dashaezhova Dec 30, 2019
48261eb
Update as per @paroche's comments
jchue Jan 2, 2020
95ddbe4
Update as per @paroche's comments
jchue Jan 2, 2020
6495b15
Update as per @paroche's comments
jchue Jan 2, 2020
0cf57ca
Updated as per @paroche's comments
jchue Jan 2, 2020
a09d162
Merge pull request #1661 from jchue/patch-3
paroche Jan 2, 2020
14e4e9f
Merge pull request #1666 from jchue/patch-8
paroche Jan 2, 2020
3f1812a
Update as per @paroche's comments
jchue Jan 2, 2020
642c701
Merge branch 'master' into patch-7
jchue Jan 2, 2020
a4a8408
Merge pull request #1700 from dashaezhova/patch-1
lex111 Jan 6, 2020
4489949
Fix typo
baooab Jan 9, 2020
7f26b91
Update 'Selection and Range' article.md
dashaezhova Jan 14, 2020
5050e72
Translated tasks to English
imabp Jan 14, 2020
2bc3c29
Translated line 10 content to English
imabp Jan 14, 2020
8523ab7
Translated Solution from Russian to English
imabp Jan 14, 2020
1a22912
Translated to English and updated.
imabp Jan 14, 2020
92658d2
Fix typo
Jan 15, 2020
e817e10
Function return example update
mdizo Jan 16, 2020
00d1051
Merge pull request #1710 from mdizo/master
iliakan Jan 16, 2020
01b3ce6
minor fixes
iliakan Jan 16, 2020
4f756bb
Merge pull request #1708 from dpyzo0o/master
iliakan Jan 16, 2020
6c00296
Change panel names according to official documentation
tarasyyyk Jan 16, 2020
1e47d90
article.md
vavlza Jan 18, 2020
49ebe88
Merge pull request #1665 from jchue/patch-7
iliakan Jan 18, 2020
b2d69c1
Merge pull request #1704 from baooab/patch-3
iliakan Jan 18, 2020
f3e4ebb
Merge pull request #1706 from dashaezhova/patch-1
iliakan Jan 18, 2020
c6b6bc3
Update article.md
paroche Jan 19, 2020
fceb83e
Merge pull request #1714 from javascript-tutorial/paroche-patch-12
paroche Jan 19, 2020
492b6e1
Update article.md
paroche Jan 19, 2020
b9bb854
Merge branch 'master' into patch-2
iliakan Jan 19, 2020
c92effe
Merge pull request #1660 from jchue/patch-2
iliakan Jan 19, 2020
e9cdefa
Merge pull request #1713 from va-z/patch-4
iliakan Jan 19, 2020
1e475bf
Merge pull request #1711 from tarasyyyk/master
iliakan Jan 19, 2020
b5ea34c
Merge pull request #1707 from imabp/master
iliakan Jan 19, 2020
6384ccb
minor fixes
iliakan Jan 19, 2020
7cd8f55
minor fixes
iliakan Jan 19, 2020
db3b3f8
minor fixes
iliakan Jan 19, 2020
b3f67cb
merging all conflicts
iliakan Jan 20, 2020
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
13 changes: 13 additions & 0 deletions 1-js/01-getting-started/4-devtools/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ Konkretus vaizdas priklauso nuo Chrome versijos, kurią naudoji. Kartais atsiran
- Čia mes galim pamatyt raudoną error message. Šiuo atveju skriptas turi nežinomą "lalala" komandą.
- Dešinėje yra clickable link'as į `bug.html:12` su skaičiumi eilutės, kurioje yra error'as.

<<<<<<< HEAD
Žemiau error message'o yra mėlynas `>` simbolis. Jis parodo "command line", kuriame mes galime rašyti JavaScript komandas. Spausk `key:Enter` kad jas paleisti (`key:Shift+Enter` kad rašyti komandas per daugiau nei vieną eilutę).
=======
Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them.
>>>>>>> db3b3f8e7a08c153ad8fa0ae50633cdf95fa8912

Dabar mes galime matyti error'us. Kaip pradžiai, to pakanka. Vėliau mes grįšim į developer tools'us ir kalbėsim apie debugginimą chapteryje <info:debugging-chrome>.

```smart header="Multi-line input"
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.

To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
```

## Firefox, Edge ir kiti

Expand All @@ -50,13 +59,17 @@ Atidaryk Preferences ir eik į "Advanced". Apačioj bus checkbox'as:

Dabar `key:Cmd+Opt+C` įjungs konsolę. Taip pat turėk omeny, kad naujas item'as "Develop" atsirado viršutiniam meniu. Jame yra daug komandų ir nustatymų.

<<<<<<< HEAD
```smart header="Kelių eilučių komandos"
Dažniausiai, jeigu konsolėje parašome vieną eilutę kodo ir paspaudžiame `key:Enter`, ji suveikia.

Tam, kad parašyti kelias eilutes, spausk `key:Shift+Enter`. Tokiu būdu mes galime parašyti ilgesnius fragmentus JavaScript kodo.
```

## Reziumė
=======
## Summary
>>>>>>> db3b3f8e7a08c153ad8fa0ae50633cdf95fa8912

- Developer tools'ai leidžia mum pamatyti errorus, paleisti komandas, analizuoti kintamuosiuos ir daugiau.
- Juos paleisti galime su `key:F12` dauguma naršklių Windows'uose. Chrome, jeigu naudojame Mac, reikaluaja `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (iš pradžių reikia aktyvuoti).
Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/03-strict-mode/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Only comments may appear above `"use strict"`.
```warn header="There's no way to cancel `use strict`"
There is no directive like `"no use strict"` that reverts the engine to old behavior.

Once we enter strict mode, there's no return.
Once we enter strict mode, there's no going back.
```

## Browser console
Expand Down
41 changes: 31 additions & 10 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ message = 123456;

Programming languages that allow such things are called "dynamically typed", meaning that there are data types, but variables are not bound to any of them.

There are seven basic data types in JavaScript. Here, we'll cover them in general and in the next chapters we'll talk about each of them in detail.
There are eight basic data types in JavaScript. Here, we'll cover them in general and in the next chapters we'll talk about each of them in detail.

## A number
## Number

```js
let n = 123;
Expand Down Expand Up @@ -62,14 +62,33 @@ Special numeric values formally belong to the "number" type. Of course they are

We'll see more about working with numbers in the chapter <info:number>.

## A string
## BigInt

In JavaScript, the "number" type cannot represent integer values larger than <code>2<sup>53</sup></code> (or less than <code>-2<sup>53</sup></code> for negatives), that's a technical limitation caused by their internal representation. That's about 16 decimal digits, so for most purposes the limitation isn't a problem, but sometimes we need really big numbers, e.g. for cryptography or microsecond-precision timestamps.

`BigInt` type was recently added to the language to represent integers of arbitrary length.

A `BigInt` is created by appending `n` to the end of an integer literal:

```js
// the "n" at the end means it's a BigInt
const bigInt = 1234567890123456789012345678901234567890n;
```

As `BigInt` numbers are rarely needed, we devoted them a separate chapter <info:bigint>.

```smart header="Compatability issues"
Right now `BigInt` is supported in Firefox and Chrome, but not in Safari/IE/Edge.
```

## String

A string in JavaScript must be surrounded by quotes.

```js
let str = "Hello";
let str2 = 'Single quotes are ok too';
let phrase = `can embed ${str}`;
let phrase = `can embed another ${str}`;
```

In JavaScript, there are 3 types of quotes.
Expand All @@ -78,7 +97,7 @@ In JavaScript, there are 3 types of quotes.
2. Single quotes: `'Hello'`.
3. Backticks: <code>&#96;Hello&#96;</code>.

Double and single quotes are "simple" quotes. There's no difference between them in JavaScript.
Double and single quotes are "simple" quotes. There's practically no difference between them in JavaScript.

Backticks are "extended functionality" quotes. They allow us to embed variables and expressions into a string by wrapping them in `${…}`, for example:

Expand All @@ -102,12 +121,12 @@ alert( "the result is ${1 + 2}" ); // the result is ${1 + 2} (double quotes do n
We'll cover strings more thoroughly in the chapter <info:string>.

```smart header="There is no *character* type."
In some languages, there is a special "character" type for a single character. For example, in the C language and in Java it is `char`.
In some languages, there is a special "character" type for a single character. For example, in the C language and in Java it is called "char".

In JavaScript, there is no such type. There's only one type: `string`. A string may consist of only one character or many of them.
```

## A boolean (logical type)
## Boolean (logical type)

The boolean type has only two values: `true` and `false`.

Expand Down Expand Up @@ -198,6 +217,8 @@ typeof undefined // "undefined"

typeof 0 // "number"

typeof 10n // "bigint"

typeof true // "boolean"

typeof "foo" // "string"
Expand All @@ -223,12 +244,12 @@ The last three lines may need additional explanation:
2. The result of `typeof null` is `"object"`. That's wrong. It is an officially recognized error in `typeof`, kept for compatibility. Of course, `null` is not an object. It is a special value with a separate type of its own. So, again, this is an error in the language.
3. The result of `typeof alert` is `"function"`, because `alert` is a function. We'll study functions in the next chapters where we'll also see that there's no special "function" type in JavaScript. Functions belong to the object type. But `typeof` treats them differently, returning `"function"`. That's not quite correct, but very convenient in practice.


## Summary

There are 7 basic data types in JavaScript.
There are 8 basic data types in JavaScript.

- `number` for numbers of any kind: integer or floating-point.
- `number` for numbers of any kind: integer or floating-point, integers are limited by ±2<sup>53</sup>.
- `bigint` is for integer numbers of arbitrary length.
- `string` for strings. A string may have one or more characters, there's no separate single-character type.
- `boolean` for `true`/`false`.
- `null` for unknown values -- a standalone type that has a single value `null`.
Expand Down
15 changes: 2 additions & 13 deletions 1-js/02-first-steps/06-type-conversions/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Type Conversions

Most of the time, operators and functions automatically convert the values given to them to the right type.
Most of the time, operators and functions automatically convert the values given to them to the right type.

For example, `alert` automatically converts any value to a string to show it. Mathematical operations convert values to numbers.

Expand Down Expand Up @@ -81,18 +81,7 @@ alert( Number(false) ); // 0

Please note that `null` and `undefined` behave differently here: `null` becomes zero while `undefined` becomes `NaN`.

````smart header="Addition '+' concatenates strings"
Almost all mathematical operations convert values to numbers. A notable exception is addition `+`. If one of the added values is a string, the other one is also converted to a string.

Then, it concatenates (joins) them:

```js run
alert( 1 + '2' ); // '12' (string to the right)
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.
````
Most mathematical operators also perform such conversion, we'll see that in the next chapter.

## Boolean Conversion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ null === +"\n0\n" → false
Some of the reasons:

1. Obviously, true.
2. Dictionary comparison, hence false.
2. Dictionary comparison, hence false. `"a"` is smaller than `"p"`.
3. Again, dictionary comparison, first char of `"2"` is greater than the first char of `"1"`.
4. Values `null` and `undefined` equal each other only.
5. Strict equality is strict. Different types from both sides lead to false.
Expand Down
Loading