Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
c9fbef1
word correction
muraha Apr 15, 2019
e9e3833
array-methods: wording
lex111 Apr 27, 2019
e41783a
regexp-character-classes: wording
lex111 Apr 27, 2019
10decb5
Fix typo
Apr 27, 2019
b10274c
Fix typo (#947)
lex111 Apr 27, 2019
5010620
Update article.md
Okoyecb Apr 27, 2019
f2328f0
Fix typo: authomatically
lex111 Apr 28, 2019
ad8a717
Array methods: minor mistake
shchegol Apr 29, 2019
6b9515f
minor
iliakan Apr 30, 2019
ae87b1a
Fix typo dynamicaly to dinamically
Apr 30, 2019
c0d068d
Fix typo dynamicaly to dinamically (#951)
lex111 Apr 30, 2019
2802a6d
replace "press" with "click"
pimonenkov Apr 30, 2019
aaab1d4
Update article.md
afeldspar Apr 30, 2019
593e122
fix
iliakan Apr 30, 2019
f8ef37f
21-regexp-unicode-properties: fix title
lex111 Apr 30, 2019
00654e3
Merge pull request #953 from afeldspar/patch-1
iliakan Apr 30, 2019
aa67109
Merge pull request #952 from pimonenkov/patch-2
iliakan Apr 30, 2019
7d23fd8
Merge pull request #949 from shchegol/master
iliakan Apr 30, 2019
0af081d
Merge pull request #948 from Okoyecb/patch-1
iliakan Apr 30, 2019
5e82fe2
Merge pull request #946 from javascript-tutorial/lex111-patch-2
iliakan Apr 30, 2019
19196e3
Merge pull request #945 from javascript-tutorial/lex111-patch-1
iliakan Apr 30, 2019
6a5f14d
6-data-storage/02-localstorage: fix highlight
lex111 May 1, 2019
ca92aed
1-js/12-generators-iterators/2-async-iterators-generators: fix typo
lex111 May 1, 2019
feebafc
Fix typos
lex111 May 1, 2019
b457de1
Replace error string with template strings
rezyx May 1, 2019
ac39b06
Merge pull request #956 from rezyx/replace-strings-11/async/02-promis…
iliakan May 2, 2019
be9dbd7
Fixed typos in defer example
yuenm18 May 3, 2019
042ebed
Fixed typos in defer example (#958)
lex111 May 3, 2019
9405358
1-js/06-advanced-functions/10-bind: fix markup
lex111 May 3, 2019
5982afb
Fix GitHub casing
rezyx May 4, 2019
5e37dbd
Fix GitHub casing (#959)
lex111 May 4, 2019
047ffa2
Update article.md
iliakan May 4, 2019
1764ee3
Fixed a small typo
luc4leone May 4, 2019
1646a74
Merge pull request #960 from luc4leone/patch-1
iliakan May 4, 2019
05f4502
fixes
iliakan May 4, 2019
1ba420f
fixes
iliakan May 4, 2019
1e99f7d
fixes
iliakan May 5, 2019
2634131
minor
iliakan May 5, 2019
6e77e3a
improvements
iliakan May 5, 2019
3623a88
up
iliakan May 6, 2019
db4d0de
fixes
iliakan May 6, 2019
702362f
8-web-components/3-shadow-dom: fix typos
lex111 May 6, 2019
ed86221
fixes
iliakan May 6, 2019
de5059f
Fix GitHub casing (04-promise-error-handling/article.md
rezyx May 6, 2019
9e598e5
Regex: moved and deleted content from the "Patterns and flags".
luc4leone May 6, 2019
40074e0
Merge pull request #964 from rezyx/fix-github-casing
lex111 May 6, 2019
dd6a630
Update solution.md
quangnd May 7, 2019
b7d7007
minor
iliakan May 7, 2019
f7a97ec
Merge pull request #965 from luc4leone/regex-intro
iliakan May 7, 2019
42f1dba
Merge pull request #967 from quangnd/patch-1
iliakan May 7, 2019
83b40bc
minor
iliakan May 7, 2019
0e5f889
fixed typo
Zyranivia May 8, 2019
c17491f
Update article.md
deniolp May 8, 2019
c8ed6f1
Added missing punctuation.
Zyranivia May 8, 2019
eabfc56
fixed typo (#968)
lex111 May 8, 2019
d15186d
fix
iliakan May 9, 2019
1a13331
Merge pull request #970 from Zyranivia/patch-2
iliakan May 9, 2019
7f5008e
Merge pull request #969 from deniolp/deniolp-patch-1
iliakan May 9, 2019
5f9597d
fix
iliakan May 9, 2019
11b1671
fixes
iliakan May 9, 2019
2addc4c
Fix typo
sparkofreason May 9, 2019
b9714f1
fix
iliakan May 9, 2019
07e09f8
Update article.md
alienfernandez May 9, 2019
2035e46
minor
iliakan May 9, 2019
4dc4272
minor
iliakan May 9, 2019
8e251ab
explanations
iliakan May 10, 2019
06f9927
remove extra article
iliakan May 10, 2019
0c2ef14
Update article.md (localstorage)
gongzemin May 10, 2019
00a01ec
Update LocalStorage
gongzemin May 10, 2019
637e8c1
Update article.md (LocalStorage) (#975)
lex111 May 10, 2019
e3c0be4
Fix typo (#971)
lex111 May 10, 2019
668bdf7
Update article.md (#972)
lex111 May 10, 2019
2b44781
fixes
iliakan May 11, 2019
f8f3c94
fix
iliakan May 11, 2019
f8570ae
fixes
iliakan May 11, 2019
29a3c58
fixes
iliakan May 11, 2019
9be9616
license
iliakan May 11, 2019
8b9aaa7
minor
iliakan May 11, 2019
5f423c8
minor
iliakan May 11, 2019
fd43d91
minor
iliakan May 11, 2019
b45c5a3
Fix typos
lex111 May 12, 2019
e6ed86c
Update article.md
gartenfeld May 13, 2019
dd67ddd
Merge pull request #978 from gartenfeld/patch-1
iliakan May 13, 2019
bc7d43c
minor
iliakan May 13, 2019
25539ce
minor
iliakan May 13, 2019
928f42d
minor
iliakan May 13, 2019
0490fa2
Fix typos
lex111 May 13, 2019
383c3db
Fix typo
lex111 May 13, 2019
f5f31e8
Fix typo
lex111 May 13, 2019
899a3ce
fixes
iliakan May 14, 2019
9df9561
Order mismatch
him2312 May 14, 2019
e4288e4
minor
iliakan May 14, 2019
a956c4f
up
iliakan May 14, 2019
2c4cc64
up
iliakan May 15, 2019
c709aa1
up
iliakan May 15, 2019
4e079a5
Fix Typo (brewity to brevity)
gongzemin May 15, 2019
1072055
minor
iliakan May 15, 2019
89d81d3
Merge pull request #1 from javascript-tutorial/master
gongzemin May 15, 2019
0d2fc22
fix
iliakan May 15, 2019
c5fab43
Fix typo, so it actually does invoke the setter
CrazyTim May 15, 2019
d11039e
Merge pull request #981 from CrazyTim/CrazyTim-patch-1
iliakan May 15, 2019
bfb3819
Spelling mistake
him2312 May 15, 2019
c43c553
Merge pull request #984 from him2312/patch-3
iliakan May 15, 2019
44bae6a
Fix typo (brewity to brevity) (#980)
lex111 May 16, 2019
43f5821
added link to exist page
shamilDzhakeev May 16, 2019
b368f37
Use relative link
lex111 May 16, 2019
40a4e18
added link to exist page (#985)
lex111 May 16, 2019
d974090
fixes
iliakan May 16, 2019
39394b9
Changed "phrase" to "phase" for capture param
oonufrienko May 16, 2019
c5f4d5b
Changed "phrase" to "phase" for capture param (#987)
lex111 May 16, 2019
98d3962
minor
iliakan May 16, 2019
c52fd3e
Fix typo
lex111 May 16, 2019
55f599e
word correction (#989)
lex111 May 16, 2019
da3ba6a
closes #990
iliakan May 17, 2019
809cebc
closes #990
iliakan May 17, 2019
ee4a91e
fix
iliakan May 17, 2019
63ffc3d
Update article.md
developerdavo May 18, 2019
6bdaf20
Mobile Browser accessibility
him2312 May 18, 2019
a830dcc
Grammar
him2312 May 19, 2019
5e2a2a1
Grammar (#996)
lex111 May 19, 2019
f751b57
Fix typo in article.md (#993)
lex111 May 19, 2019
e7d6d4a
Merge pull request #995 from him2312/patch-5
iliakan May 19, 2019
dd106ba
class
iliakan May 19, 2019
00d8b63
minor
iliakan May 19, 2019
0f5e44e
Merge pull request #979 from him2312/patch-2
iliakan May 19, 2019
47c2d22
Update README.md
iliakan May 19, 2019
49264e2
minor
iliakan May 19, 2019
3e5db10
Fix a little typo.
May 19, 2019
b52dd6f
Fix a little typo. (#997)
lex111 May 19, 2019
5c6a3f0
fixes
iliakan May 19, 2019
f651e96
minor
iliakan May 19, 2019
d7834f2
Fixed an error in the 'An incomparable undefined' section. The value …
May 20, 2019
4ffbb3b
Grave accent
alfiya-udc May 20, 2019
2b804eb
minor
iliakan May 20, 2019
49aef00
fixes
iliakan May 20, 2019
6972b41
Merge pull request #999 from alfiya-udc/master
iliakan May 20, 2019
3ce2d96
Merge pull request #998 from GodAzaldin/master
iliakan May 20, 2019
7d6d436
minor
iliakan May 21, 2019
cfff5c1
minor
iliakan May 21, 2019
db32cd0
minor
iliakan May 21, 2019
7f1d5de
minor
iliakan May 21, 2019
bdda1af
minor
iliakan May 23, 2019
9f7235d
minor
iliakan May 23, 2019
d421e02
Update article.md
maurodibert May 23, 2019
33e1243
change spelling
nabaraj May 23, 2019
df7800a
improvement
iliakan May 23, 2019
397ee9a
specifying the property inside Environment Record
Violet-Bora-Lee May 24, 2019
4594d12
update comment on sample code
Violet-Bora-Lee May 24, 2019
4d17a15
Merge pull request #1007 from Violet-Bora-Lee/patch-3
iliakan May 24, 2019
d8cc5c4
Merge pull request #1005 from nabaraj/patch-1
iliakan May 24, 2019
3a24b0a
Merge pull request #1006 from Violet-Bora-Lee/patch-2
iliakan May 24, 2019
4879734
Merge pull request #1004 from maurodibert/patch-47
iliakan May 24, 2019
c7ba283
typo
maurodibert May 25, 2019
2bc3aae
Merge pull request #1009 from maurodibert/patch-48
iliakan May 25, 2019
a2cb3c6
Update solution.md
maurodibert May 25, 2019
09db684
Merge pull request #1012 from maurodibert/patch-49
iliakan May 25, 2019
f8a00f4
Update solution.md
maurodibert May 25, 2019
3e6f2d0
Fix typos
KenjiI May 25, 2019
f0affb7
minor
iliakan May 25, 2019
a747a2c
delete wrong comment
T1mL3arn May 25, 2019
f10e34b
Merge pull request #1015 from T1mL3arn/patch-1
iliakan May 25, 2019
895b46a
Merge pull request #1014 from KenjiI/patch-3
iliakan May 25, 2019
9b03ee7
Merge pull request #1013 from maurodibert/patch-50
iliakan May 25, 2019
49fbecc
clear declarations
iliakan May 26, 2019
7df2a2a
Update article.md
maurodibert May 26, 2019
ebe532e
del redundant 'then'
T1mL3arn May 26, 2019
be235bc
Del redundant 'then' word (#1019)
lex111 May 26, 2019
4ac1def
Merge pull request #1016 from maurodibert/patch-51
iliakan May 26, 2019
fabf802
Update article.md
iliakan May 26, 2019
5c6a8ec
minor
iliakan May 26, 2019
5f095cc
improvements
iliakan May 26, 2019
c4f6b24
fix css comments
T1mL3arn May 27, 2019
297ae60
Change number of flags
vasilevx May 27, 2019
a9a0156
Merge pull request #1021 from vasilevx/patch-2
iliakan May 27, 2019
feebcc8
Merge pull request #1020 from T1mL3arn/master
iliakan May 27, 2019
0641d55
Fix typo
lex111 May 28, 2019
50d7cc2
minor
iliakan May 28, 2019
878ce62
Update article.md
tonchique May 28, 2019
5a91716
Update article.md
tonchique May 28, 2019
56365ae
minor
iliakan May 28, 2019
ae776d8
Fix Websocket article typo
skmetaly May 28, 2019
9adabf8
Merge pull request #1024 from skmetaly/fix-websocket-typo
iliakan May 28, 2019
fde93c9
Merge pull request #1023 from tonchique/patch-2
iliakan May 28, 2019
3dd9fb0
Merge pull request #1022 from tonchique/patch-1
iliakan May 28, 2019
16e7d07
Fix typos
lex111 May 29, 2019
0873473
minor
iliakan May 29, 2019
610c628
merging all conflicts
iliakan May 30, 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/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Vamos ver o que há de tão especial no JavaScript, o que podemos fazer com ele,

*JavaScript* foi inicialmente criado para *" tornar páginas web vivas "*.

<<<<<<< HEAD
Os programas nesta linguagem são chamados de *scripts*. Eles podem ser escritos diretamente no HTML de uma página web e executados automaticamente quando a página é carregada.
=======
The programs in this language are called *scripts*. They can be written right in a web page's HTML and run automatically as the page loads.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

Os scripts são fornecidos e executados como texto puro. Eles não precisam de preparação ou compilação especial para serem executados.

Expand Down Expand Up @@ -70,7 +74,11 @@ Exemplos de tais restrições incluem:
Existem maneiras de interagir com a câmera / microfone e outros dispositivos, mas eles exigem permissão explícita do usuário. Assim, uma página habilitada para JavaScript pode não habilmente habilitar uma câmera web, observar os arredores e enviar as informações para a [NSA](https://pt.wikipedia.org/wiki/Ag%C3%AAncia_de_Seguran%C3%A7a_Nacional).
- Diferentes abas/janelas geralmente não se conhecem mutuamente. Às vezes sim, por exemplo, quando uma janela usa JavaScript para abrir a outra. Mas mesmo neste caso, JavaScript de uma página pode não acessar a outra se eles vierem de sites diferentes (de um domínio, protocolo ou porta diferente).

<<<<<<< HEAD
Isso é chamado de "Política de mesma origem ". Para contornar isso, *ambas as páginas* devem conter um código JavaScript especial que lida com a troca de dados.
=======
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

Essa limitação é, novamente, para a segurança do usuário. Uma página de `http://umsitequalquer.com.br` que um usuário abriu não deve poder alcançar uma outra aba do navegador com a URL `http://gmail.com` e roubar a informação de lá.
- O JavaScript pode se comunicar facilmente pela rede com o servidor de onde a página atual veio. Mas sua capacidade de receber dados de outros sites / domínios é prejudicada. Embora possível, requer acordo explícito (expresso em cabeçalhos HTTP) do lado remoto. Mais uma vez, isso é uma limitação de segurança.
Expand Down
9 changes: 9 additions & 0 deletions 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Olá, mundo!

<<<<<<< HEAD
O tutorial que você está lendo é sobre a core do JavaScript, que é independente de plataforma. Mais tarde, você vai aprender sobre Node.js e outras plataformas que o usam.
=======
This part of the tutorial is about core JavaScript, the language itself. Later on, you'll learn about Node.js and other platforms that use it.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

Mas precisamos de um ambiente de trabalho para rodar nossos scripts e, como esse livro está online, o navegador é uma boa escolha. Vamos manter a quantidade de comandos específicos do navegador (como `alert`) no mínimo para que você não gaste tempo com eles se você planeja se concentrar em outro ambiente (como Node.js). Vamos focar em JavaScript no navegador na [próxima parte](/ui) do tutorial.

Expand Down Expand Up @@ -45,8 +49,13 @@ A tag `<script>` contém código JavaScript que é executado automaticamente qua

A tag `<script>` tem alguns atributos que raramente são usados hoje em dia, mas que ainda podem ser encontrados em códigos antigos:

<<<<<<< HEAD
O atributo `type`: <code>&lt;script <u>type</u>=...&gt;</code>
: O antigo padrão HTML, HTML4, requeria um script para ter um `type`. Normalmente era `type="text/javascript"`. Não é mais necessário. Além disso, o moderno padrão HTML, HTML5, mudou totalmente o significado deste atributo. Agora, ele pode ser usado para módulos JavaScript. Mas esse é um tópico avançado; vamos falar sobre módulos em outra parte do tutorial.
=======
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard, HTML5, totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic; we'll talk about modules in another part of the tutorial.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

O atributo `language`: <code>&lt;script <u>language</u>=...&gt;</code>
: Este atributo foi criado para mostrar o idioma do script. Este atributo não faz mais sentido porque JavaScript é a linguagem padrão. Não há necessidade de usá-lo.
Expand Down
18 changes: 18 additions & 0 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,13 @@ alert(hello); // Olá Mundo!
alert(message); // Olá Mundo!
```

<<<<<<< HEAD
```smart header="Linguagens funcionais"
É interessante notar que linguagens de programação [funcional](https://en.wikipedia.org/wiki/Functional_programming), como [Scala](http://www.scala-lang.org/) or [Erlang](http://www.erlang.org/), proibem a modificação de valores de variáveis.
=======
```smart header="Functional languages"
It's interesting to note that there exist [functional](https://en.wikipedia.org/wiki/Functional_programming) programming languages, like [Scala](http://www.scala-lang.org/) or [Erlang](http://www.erlang.org/) that forbid changing variable values.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

Em tais linguagens, uma vez que o valor é armazenado "na box", ele está lá para sempre. Se precisarmos de armazenar algo mais, a linguagem nos obriga a criar uma nova box (declarar uma nova variável). Não podemos reutilizar a antiga.

Expand Down Expand Up @@ -182,8 +187,13 @@ let my-name; // hífens '-' não são permitidos no nome
Variáveis chamadas `apple` e `AppLE` são duas variáveis diferentes.
```

<<<<<<< HEAD
````smart header="Letras não inglesas são permitidas, mas não são recomendadas"
É possível usar qualquer idioma, incluindo letras cirílicas ou até hieróglifos, como este:
=======
````smart header="Non-Latin letters are allowed, but not recommended"
It is possible to use any language, including cyrillic letters or even hieroglyphs, like this:
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

```js
let имя = '...';
Expand Down Expand Up @@ -254,7 +264,11 @@ Há uma prática generalizada de usar constantes como aliases para valores difí

Tais constantes são nomeadas usando letras maiúsculas e sublinhados.

<<<<<<< HEAD
Como estas:
=======
For instance, let's make constants for colors in so-called "web" (hexadecimal) format:
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

```js run
const COLOR_RED = "#F00";
Expand Down Expand Up @@ -290,7 +304,11 @@ Em outras palavras, constantes com nomes maiúsculos são usadas apenas como pse

Falando em variáveis, há mais uma coisa extremamente importante.

<<<<<<< HEAD
Por favor, nomeie as suas variáveis de forma sensata. Tome tempo para pensar sobre isso.
=======
A variable name should have a clean, obvious meaning, describe the data that it stores.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

A nomenclatura variável é uma das habilidades mais importantes e complexas em programação. Uma rápida olhada em nomes de variáveis pode revelar qual código foi escrito por um iniciante versus um desenvolvedor experiente.

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ As três últimas linhas podem precisar de explicações adicionais:

## Resumo

<<<<<<< HEAD
Existem 7 tipos básicos em JavaScript.
=======
There are 7 basic data types in JavaScript.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

- `number` para números de qualquer tipo: inteiro ou ponto flutuante.
- `string` para cordas. Uma cadeia de caracteres pode ter um ou mais caracteres, não há nenhum tipo de caractere único separado.
Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/08-comparison/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Why does it dislike zero so much? Always false!
We get these results because:

- Comparisons `(1)` and `(2)` return `false` because `undefined` gets converted to `NaN` and `NaN` is a special numeric value which returns `false` for all comparisons.
- The equality check `(3)` returns `false` because `undefined` only equals `null` and no other value.
- The equality check `(3)` returns `false` because `undefined` only equals `null`, `undefined`, and no other value.

### Evade problems

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/09-alert-prompt-confirm/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interaction: alert, prompt, confirm

This part of the tutorial aims to cover JavaScript "as is", without environment-specific tweaks.
In this part of the tutorial we cover JavaScript language "as is", without environment-specific tweaks.

But we'll still be using the browser as our demo environment, so we should know at least a few of its user-interface functions. In this chapter, we'll get familiar with the browser functions `alert`, `prompt` and `confirm`.

Expand Down
10 changes: 5 additions & 5 deletions 1-js/02-first-steps/10-ifelse/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Sometimes, we need to perform different actions based on different conditions.

To do that, we use the `if` statement and the conditional (ternary) operator which we will be referring to as the “question mark operator `?` for simplicity.
To do that, we can use the `if` statement and the conditional operator `?`, that's also called a "question mark" operator.

## The "if" statement

Expand Down Expand Up @@ -103,7 +103,7 @@ In the code above, JavaScript first checks `year < 2015`. If that is falsy, it g

There can be more `else if` blocks. The final `else` is optional.

## Ternary operator '?'
## Conditional operator '?'

Sometimes, we need to assign a variable depending on a condition.

Expand All @@ -124,9 +124,9 @@ if (age > 18) {
alert(accessAllowed);
```

The so-called "ternary" or "question mark" operator lets us do that in a shorter and simpler way.
The so-called "conditional" or "question mark" operator lets us do that in a shorter and simpler way.

The operator is represented by a question mark `?`. The formal term "ternary" means that the operator has three operands. It is actually the one and only operator in JavaScript which has that many.
The operator is represented by a question mark `?`. Sometimes it's called "ternary", because the operator has three operands. It is actually the one and only operator in JavaScript which has that many.

The syntax is:
```js
Expand All @@ -141,7 +141,7 @@ For example:
let accessAllowed = (age > 18) ? true : false;
```

Technically, we can omit the parentheses around `age > 18`. The question mark operator has a low precedence, so it executes after the comparison `>`.
Technically, we can omit the parentheses around `age > 18`. The question mark operator has a low precedence, so it executes after the comparison `>`.

This example will do the same thing as the previous one:

Expand Down
6 changes: 3 additions & 3 deletions 1-js/02-first-steps/11-logical-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The OR `||` operator does the following:

A value is returned in its original form, without the conversion.

In other words, a chain of OR `"||"` returns the first truthy value or the last one if no such value is found.
In other words, a chain of OR `"||"` returns the first truthy value or the last one if no truthy value is found.

For instance:

Expand All @@ -101,7 +101,7 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl

1. **Getting the first truthy value from a list of variables or expressions.**

Imagine we have several variables which can either contain data or be `null/undefined`. How can we find the first one with data?
Imagine we have a list of variables which can either contain data or be `null/undefined`. How can we find the first one with data?

We can use OR `||`:

Expand Down Expand Up @@ -143,7 +143,7 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl
alert(x); // 1
```

An assignment is a simple case. Other side effects can also be involved.
An assignment is a simple case. There may be side effects, that won't show up if the evaluation doesn't reach them.

As we can see, such a use case is a "shorter way of doing `if`". The first operand is converted to boolean. If it's false, the second one is evaluated.

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 @@ -47,8 +47,8 @@ while (i) { // when i becomes 0, the condition becomes falsy, and the loop stops
}
```

````smart header="Brackets are not required for a single-line body"
If the loop body has a single statement, we can omit the brackets `{…}`:
````smart header="Curly braces are not required for a single-line body"
If the loop body has a single statement, we can omit the curly braces `{…}`:

```js run
let i = 3;
Expand Down
6 changes: 3 additions & 3 deletions 1-js/02-first-steps/14-function-basics/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ showMessage();
alert( userName ); // *!*Bob*/!*, the value was modified by the function
```

The outer variable is only used if there's no local one. So an occasional modification may happen if we forget `let`.
The outer variable is only used if there's no local one.

If a same-named variable is declared inside the function then it *shadows* the outer one. For instance, in the code below the function uses the local `userName`. The outer one is ignored:

Expand All @@ -128,7 +128,7 @@ Variables declared outside of any function, such as the outer `userName` in the

Global variables are visible from any function (unless shadowed by locals).

Usually, a function declares all variables specific to its task. Global variables only store project-level data, and it's important that these variables are accessible from anywhere. Modern code has few or no globals. Most variables reside in their functions.
It's a good practice to minimize the use of global variables. Modern code has few or no globals. Most variables reside in their functions. Sometimes though, they can be useful to store project-level data.
```

## Parameters
Expand Down Expand Up @@ -376,7 +376,7 @@ A few examples of breaking this rule:
- `createForm` -- would be bad if it modifies the document, adding a form to it (should only create it and return).
- `checkPermission` -- would be bad if it displays the `access granted/denied` message (should only perform the check and return the result).

These examples assume common meanings of prefixes. What they mean for you is determined by you and your team. Maybe it's pretty normal for your code to behave differently. But you should have a firm understanding of what a prefix means, what a prefixed function can and cannot do. All same-prefixed functions should obey the rules. And the team should share the knowledge.
These examples assume common meanings of prefixes. You and your team are free to agree on other meanings, but usually they're not much different. In any case, you should have a firm understanding of what a prefix means, what a prefixed function can and cannot do. All same-prefixed functions should obey the rules. And the team should share the knowledge.
```

```smart header="Ultrashort function names"
Expand Down
6 changes: 3 additions & 3 deletions 1-js/02-first-steps/15-function-expressions-arrows/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ We can pass it between variables and run when we want.

Let's formulate the key differences between Function Declarations and Expressions.

First, the syntax: how to see what is what in the code.
First, the syntax: how to differentiate between them in the code.

- *Function Declaration:* a function, declared as a separate statement, in the main code flow.

Expand All @@ -186,7 +186,7 @@ First, the syntax: how to see what is what in the code.
}
```
- *Function Expression:* a function, created inside an expression or inside another syntax construct. Here, the function is created at the right side of the "assignment expression" `=`:

```js
// Function Expression
let sum = function(a, b) {
Expand All @@ -202,7 +202,7 @@ Once the execution flow passes to the right side of the assignment `let sum = fu

Function Declarations are different.

**A Function Declaration is usable in the whole script/code block.**
**A Function Declaration is usable in the whole script (or a code block, if it's inside a block).**

In other words, when JavaScript *prepares* to run the script or a code block, it first looks for Function Declarations in it and creates the functions. We can think of it as an "initialization stage".

Expand Down
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/16-javascript-specials/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ More in: <info:variables> and <info:types>.
We're using a browser as a working environment, so basic UI functions will be:

[`prompt(question, [default])`](mdn:api/Window/prompt)
: Ask a `question`, and return either what the visitor entered or `null` if they pressed "cancel".
: Ask a `question`, and return either what the visitor entered or `null` if they clicked "cancel".

[`confirm(question)`](mdn:api/Window/confirm)
: Ask a `question` and suggest to choose between Ok and Cancel. The choice is returned as `true/false`.
Expand Down Expand Up @@ -161,7 +161,7 @@ Comparisons

Other comparisons convert to a number as well.

The strict equality operator `===` doesn't do the conversion: different types always mean different values for it, so:
The strict equality operator `===` doesn't do the conversion: different types always mean different values for it.

Values `null` and `undefined` are special: they equal `==` each other and don't equal anything else.

Expand Down
4 changes: 2 additions & 2 deletions 1-js/03-code-quality/01-debugging-chrome/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Here's what you should see if you are doing it for the first time:

The toggler button <span class="devtools" style="background-position:-168px -76px"></span> opens the tab with files.

Let's click it and select `index.html` and then `hello.js` in the tree view. Here's what should show up:
Let's click it and select `hello.js` in the tree view. Here's what should show up:

![](chrome-tabs.png)

Expand All @@ -34,7 +34,7 @@ Now you could click the same toggler <span class="devtools" style="background-po

## Console

If we press `Esc`, then a console opens below. We can type commands there and press `key:Enter` to execute.
If we press `key:Esc`, then a console opens below. We can type commands there and press `key:Enter` to execute.

After a statement is executed, its result is shown below.

Expand Down
Loading