Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ let userName;
let test123;
```

<<<<<<< HEAD
Quando o nome contém várias palavras, o [camelCase](https://en.wikipedia.org/wiki/CamelCase) é normalmente utilizado. Isto é: as palavras vão uma após a outra, e cada palavra exceto a primeira começa com uma letra maiúscula: `myVeryLongName`.
=======
When the name contains multiple words, [camelCase](https://en.wikipedia.org/wiki/CamelCase) is commonly used. That is: words go one after another, with each word except the first starting with a capital letter: `myVeryLongName`.
>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11

O que é interessante -- o sinal de dólar `'$'` e o sublinhado `'_'` também podem ser usados em nomes. Eles são símbolos regulares, assim como letras, sem nenhum significado especial.

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/08-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ alert( c ); // 4

Atribuições encadeadas são avaliadas da direita para a esquerda. Primeiro, a expressão mais à direita `2 + 2` é avaliada e então atribuída às variáveis na esquerda: `c`, `b` e `a`. No fim, todas as variáveis compartilham um mesmo valor.

<<<<<<< HEAD
Uma vez mais, para o propósito de legibilidade é melhor dividir tal código em algumas linhas:
=======
Once again, for the purposes of readability it's better to split such code into a few lines:
>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11

```js
c = 2 + 2;
Expand Down
17 changes: 17 additions & 0 deletions 1-js/03-code-quality/02-coding-style/1-style-errors/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Poderia notar o seguinte:

```js no-beautify
<<<<<<< HEAD
function pow(x,n) // <- nenhum espaço entre argumentos
{ // <- chaveta de abertura numa linha em separado
let result=1; // <- nenhum espaço antes ou depois de =
Expand All @@ -16,6 +17,22 @@ if (n<0) // <- nenhum espaço dentro (n < 0), e deveria existir uma linha extra
{ // <- chaveta de abertura numa linha em separado
// abaixo - linhas longas podem ser repartidas por múltiplas linhas para melhorar a legíbilidade
alert(`A potência de ${n} não é suportada, por favor insira um número inteiro maior do que zero`);
=======
function pow(x,n) // <- no space between arguments
{ // <- curly brace on a separate line
let result=1; // <- no spaces before or after =
for(let i=0;i<n;i++) {result*=x;} // <- no spaces
// the contents of { ... } should be on a new line
return result;
}

let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
// but better make it 2 lines, also there's no spaces and missing ;
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
{ // <- curly brace on a separate line
// below - long lines can be split into multiple lines for improved readability
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11
}
else // <- poderia ser escrito numa única linha, como "} else {"
{
Expand Down
8 changes: 8 additions & 0 deletions 1-js/04-object-basics/01-object/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ Como sabemos, pelo capítulo <info:types>, existem oito tipos de dados em JavaSc

Em contraste, objetos são usados para armazenar, por meio de uma chave, coleções de vários dados e entidades mais complexas. Em JavaScript, os objetos penetram em quase todos os aspetos da linguagem. Portanto, devemos primeiro os compreender antes de nos envolver com detalhe em algo mais.

<<<<<<< HEAD
Um objeto pode ser criado por chavetas `{…}`, com uma lista opcional de *propriedades*. Uma propriedade é um par "key: value" (chave: valor), onde `key` é uma *string* (também chamada de "nome da propriedade"), e `value` pode ser qualquer coisa.
=======
An object can be created with curly braces `{…}` with an optional list of *properties*. A property is a "key: value" pair, where `key` is a string (also called a "property name"), and `value` can be anything.
>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11

Podemos imaginar um objeto como um fichário com ficheiros assinados. Cada peça de informação, é armazenada no seu ficheiro por meio de uma chave. É fácil encontrar um ficheiro através do seu nome, ou adicionar/remover um ficheiro.

Expand All @@ -20,7 +24,11 @@ let user = {}; // sintaxe de "objeto literal"

![](object-user-empty.svg)

<<<<<<< HEAD
Geralmente, são utilizadas as chavetas `{...}`. Essa declaração é chamada de *objeto literal*.
=======
Usually, the curly braces `{...}` are used. That declaration is called an *object literal*.
>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11

## Literais e propriedades

Expand Down
2 changes: 1 addition & 1 deletion 1-js/05-data-types/10-destructuring-assignment/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ That works, because internally a destructuring assignment works by iterating ove
````


````smart header="Assign to anything at the left-side"
````smart header="Assign to anything on the left-side"
We can use any "assignables" on the left side.
For instance, an object property:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ And here is the picture for the nested `setTimeout`:

![](settimeout-interval.svg)

**The nested `setTimeout` guarantees the fixed delay (here 100ms).**
**The nested `setTimeout` ensures a minimum delay (100ms here) between the end of one call and the beginning of the subsequent one.**

That's because a new call is planned at the end of the previous one.

Expand Down