Skip to content

Commit 900528c

Browse files
authored
Merge pull request #39 from javascript-tutorial/sync-5cb9760a
Sync with upstream @ 5cb9760
2 parents f2023a4 + c6f147a commit 900528c

File tree

425 files changed

+9309
-5125
lines changed

Some content is hidden

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

425 files changed

+9309
-5125
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto eol=lf
2+
*.svg binary

1-js/01-getting-started/1-intro/article.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Vamos ver o que há de tão especial no JavaScript, o que podemos fazer com ele,
66

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

9+
<<<<<<< HEAD
910
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.
11+
=======
12+
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.
13+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca
1014
1115
Os scripts são fornecidos e executados como texto puro. Eles não precisam de preparação ou compilação especial para serem executados.
1216

@@ -70,7 +74,11 @@ Exemplos de tais restrições incluem:
7074
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).
7175
- 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).
7276

77+
<<<<<<< HEAD
7378
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.
79+
=======
80+
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.
81+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca
7482
7583
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á.
7684
- 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.
@@ -92,8 +100,12 @@ JavaScript é a única tecnologia de navegador que combina estas três qualidade
92100

93101
Isso é o que torna o JavaScript único. É por isso que é a ferramenta mais difundida para criar interfaces de navegador.
94102

103+
<<<<<<< HEAD
95104
Ao passo que planeja aprender uma nova tecnologia, é benéfico verificar suas perspectivas. Então, vamos seguir para as tendências modernas que o afetam, incluindo novas linguagens e habilidades de navegador.
96105

106+
=======
107+
That said, JavaScript also allows to create servers, mobile applications, etc.
108+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca
97109
98110
## Linguagens "sobre" JavaScript
99111

@@ -107,11 +119,20 @@ Ferramentas modernas tornam a transpilação muito rápida e transparente, permi
107119

108120
Exemplos de tais linguagens:
109121

122+
<<<<<<< HEAD
110123
- [CoffeeScript](http://coffeescript.org/) é um "açúcar sintático" para JavaScript. Ele introduz uma sintaxe mais curta, permitindo-nos escrever um código mais claro e preciso. Normalmente, Ruby devs gostam dele.
111124
- [TypeScript](http://www.typescriptlang.org/) está concentrado em adicionar "dados estritos de digitação" para simplificar o desenvolvimento e suporte de sistemas complexos. É desenvolvido pela Microsoft.
112125
- [Dart](https://www.dartlang.org/) é uma linguagem autônoma que tem seu próprio mecanismo que roda em ambientes sem navegador (como aplicativos móveis). Ela foi inicialmente oferecida pelo Google como um substituto para JavaScript, mas a partir de agora, os navegadores exigem que ela seja transpilada para JavaScript da mesma forma que as anteriores.
113126

114127
Há mais. Claro que, mesmo que usemos uma dessas linguagens, também devemos saber JavaScript para entender o que estamos fazendo.
128+
=======
129+
- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
130+
- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
131+
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
132+
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
133+
134+
There are more. Of course, even if we use one of transpiled languages, we should also know JavaScript to really understand what we're doing.
135+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca
115136
116137
## Resumo
117138

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# Manuals and specifications
3+
4+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources.
5+
6+
## Specification
7+
8+
**The ECMA-262 specification** contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
9+
10+
But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.
11+
12+
The latest draft is at <https://tc39.es/ecma262/>.
13+
14+
To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at <https://github.com/tc39/proposals>.
15+
16+
Also, if you're in developing for the browser, then there are other specs covered in the [second part](info:browser-environment) of the tutorial.
17+
18+
## Manuals
19+
20+
- **MDN (Mozilla) JavaScript Reference** is a manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
21+
22+
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
23+
24+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for `parseInt` function.
25+
26+
27+
- **MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.
28+
29+
Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
30+
31+
## Compatibility tables
32+
33+
JavaScript is a developing language, new features get added regularly.
34+
35+
To see their support among browser-based and other engines, see:
36+
37+
- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
38+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
39+
40+
All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
41+
42+
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.

1-js/01-getting-started/2-code-editors/article.md renamed to 1-js/01-getting-started/3-code-editors/article.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Uma IDE carrega o projeto (que pode ter muitos arquivos), permite navegação en
1212

1313
Se você ainda não tiver selecionado uma IDE, considere as seguintes opções:
1414

15+
<<<<<<< HEAD:1-js/01-getting-started/2-code-editors/article.md
1516
- [WebStorm](http://www.jetbrains.com/webstorm/) para desenvolvimento de front-end. A mesma empresa oferece outros editores para outras linguagens (pago).
1617
- [Netbeans](http://netbeans.org/) (livre).
1718

@@ -20,6 +21,14 @@ Todas essas IDEs são multi-plataforma.
2021
Para Windows, há também "Visual Studio", que não deve ser confundido com "Visual Studio Code". "Visual Studio" é um editor pago e poderoso somente para Windows, bem adequado para a plataforma .NET . Uma versão gratuita é chamada [Visual Studio Community](https://www.visualstudio.com/vs/community/).
2122

2223
Muitas IDEs são pagas, mas têm um período experimental. Seu custo é geralmente desprezível comparado ao salário de um desenvolvedor qualificado, então basta escolher o melhor para você.
24+
=======
25+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
26+
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
27+
28+
For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [Visual Studio Community](https://www.visualstudio.com/vs/community/).
29+
30+
Many 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.
31+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca:1-js/01-getting-started/3-code-editors/article.md
2332
2433
## Editores leves
2534

@@ -33,6 +42,7 @@ Na prática, os editores leves podem ter muitos plug-ins, incluindo analisadores
3342

3443
As seguintes opções merecem sua atenção:
3544

45+
<<<<<<< HEAD:1-js/01-getting-started/2-code-editors/article.md
3646
- [Visual Studio Code](https://code.visualstudio.com/) (plataforma cruzada, livre) também tem muitos recursos similares a IDE.
3747
- [Atom](https://atom.io/) (multi-plataforma, livre).
3848
- [Sublime Text](http://www.sublimetext.com) (multi-plataforma, shareware).
@@ -49,6 +59,14 @@ Eu estou usando:
4959
- Como um editor de peso leve -- [Sublime Text](http://www.sublimetext.com) ou [Atom](https://atom.io/).
5060

5161
## Não vamos discutir
62+
=======
63+
- [Atom](https://atom.io/) (cross-platform, free).
64+
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
65+
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
66+
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
67+
68+
## Let's not argue
69+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca:1-js/01-getting-started/3-code-editors/article.md
5270
5371
Os editores nas listas acima são aqueles que eu ou os meus amigos que eu considero bons desenvolvedores têm usado por um longo tempo e estão felizes com eles.
5472

-105 KB
Binary file not shown.
Binary file not shown.

1-js/01-getting-started/3-devtools/article.md renamed to 1-js/01-getting-started/4-devtools/article.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ Abra Preferências e vá para o painel "Avançado". Há uma caixa de seleção n
4949

5050
Agora o `key:Cmd+Opt+C` pode alternar o console. Além disso, note que o novo item do menu superior chamado "Develop" apareceu. Ele tem muitos comandos e opções.
5151

52+
<<<<<<< HEAD:1-js/01-getting-started/3-devtools/article.md
5253
## Entrada multi-linha
5354

5455
Normalmente, quando colocamos uma linha de código no console, e então pressionamos `key:Enter`, ele executa.
5556

5657
Para inserir várias linhas, pressione `key:Shift+Enter`.
58+
=======
59+
```smart header="Multi-line input"
60+
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
61+
62+
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
63+
```
64+
>>>>>>> 5cb9760abb8499bf1e99042d866c3c1db8cd61ca:1-js/01-getting-started/4-devtools/article.md
5765
5866
## Resumo
5967

0 commit comments

Comments
 (0)