Skip to content

Commit da79189

Browse files
chore: translate functions - local variables and outer variables headers
Functions - Local variables and outer variables headers
2 parents b681b75 + 506915a commit da79189

File tree

6 files changed

+173
-174
lines changed

6 files changed

+173
-174
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
No difference!
1+
Nenhuma diferença!
22

3-
In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy.
3+
Em ambos os casos, `return confirm('Seus pais permitiram?')` é executado exatamente quando a condição `if` é falsa.

1-js/02-first-steps/15-function-basics/1-if-else-required/task.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 4
22

33
---
44

5-
# Is "else" required?
5+
# "else" é obrigatório?
66

7-
The following function returns `true` if the parameter `age` is greater than `18`.
7+
A função a seguir retorna `true` se o parâmetro `age` for maior que `18`.
88

9-
Otherwise it asks for a confirmation and returns its result:
9+
Caso contrário, ele pede uma confirmação e retorna seu resultado:
1010

1111
```js
1212
function checkAge(age) {
@@ -15,13 +15,13 @@ function checkAge(age) {
1515
*!*
1616
} else {
1717
// ...
18-
return confirm('Did parents allow you?');
18+
return confirm('Seus pais permitiram?');
1919
}
2020
*/!*
2121
}
2222
```
2323

24-
Will the function work differently if `else` is removed?
24+
A função funcionará de forma diferente se `else` for removido?
2525

2626
```js
2727
function checkAge(age) {
@@ -30,9 +30,9 @@ function checkAge(age) {
3030
}
3131
*!*
3232
// ...
33-
return confirm('Did parents allow you?');
33+
return confirm('Seus pais permitiram?');
3434
*/!*
3535
}
3636
```
3737

38-
Is there any difference in the behavior of these two variants?
38+
Existe alguma diferença no comportamento dessas duas variantes?
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Using a question mark operator `'?'`:
1+
Usando o operador de ponto de interrogação `'?'`:
22

33
```js
44
function checkAge(age) {
5-
return (age > 18) ? true : confirm('Did parents allow you?');
5+
return (age > 18) ? true : confirm('Seus pais permitiram?');
66
}
77
```
88

9-
Using OR `||` (the shortest variant):
9+
Usando OR `||` (a variante mais curta):
1010

1111
```js
1212
function checkAge(age) {
13-
return (age > 18) || confirm('Did parents allow you?');
13+
return (age > 18) || confirm('Seus pais permitiram?');
1414
}
1515
```
1616

17-
Note that the parentheses around `age > 18` are not required here. They exist for better readability.
17+
Observe que os parênteses em torno de `age > 18` não são necessários aqui. Eles existem para melhor legibilidade.

1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ importance: 4
22

33
---
44

5-
# Rewrite the function using '?' or '||'
5+
# Reescreva a função usando '?' ou '||'
66

7-
The following function returns `true` if the parameter `age` is greater than `18`.
7+
A função a seguir retorna `true` se o parâmetro `age` for maior que `18`.
88

9-
Otherwise it asks for a confirmation and returns its result.
9+
Caso contrário, ele pede uma confirmação e retorna seu resultado.
1010

1111
```js
1212
function checkAge(age) {
1313
if (age > 18) {
1414
return true;
1515
} else {
16-
return confirm('Did parents allow you?');
16+
return confirm('Seus pais permitiram?');
1717
}
1818
}
1919
```
2020

21-
Rewrite it, to perform the same, but without `if`, in a single line.
21+
Reescreva-o, para executar o mesmo, mas sem `if`, em uma única linha.
2222

23-
Make two variants of `checkAge`:
23+
Faça duas variantes de `checkAge`:
2424

25-
1. Using a question mark operator `?`
26-
2. Using OR `||`
25+
1. Usando o operador de ponto de interrogação `?`
26+
2. Usando OR `||`

1-js/02-first-steps/15-function-basics/4-pow/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ importance: 4
44

55
# Function pow(x,n)
66

7-
Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, multiplies `x` by itself `n` times and returns the result.
7+
Escreva uma função `pow(x,n)` que retorna `x` na potência `n`. Ou, em outras palavras, multiplica `x` por ele mesmo `n` vezes e retorna o resultado.
88

99
```js
1010
pow(3, 2) = 3 * 3 = 9
1111
pow(3, 3) = 3 * 3 * 3 = 27
1212
pow(1, 100) = 1 * 1 * ...* 1 = 1
1313
```
1414

15-
Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`.
15+
Crie uma página da Web que solicite `x` e `n` e mostre o resultado de `pow(x,n)`.
1616

1717
[demo]
1818

19-
P.S. In this task the function should support only natural values of `n`: integers up from `1`.
19+
PS Nesta tarefa, a função deve suportar apenas valores naturais de `n`: inteiros acima de `1`.

0 commit comments

Comments
 (0)