File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
1-js/02-first-steps/14-function-basics/2-rewrite-function-question-or Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2,25 +2,25 @@ importance: 4
2
2
3
3
---
4
4
5
- # Rewrite the function using '?' or '||'
5
+ # Reescreva a função usando '?' ou '||'
6
6
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 ` é maior que ` 18 ` .
8
8
9
- Otherwise it asks for a confirmation and returns its result .
9
+ Caso contrário, pede por uma confirmação e retorna seu resultado .
10
10
11
11
``` js
12
12
function checkAge (age ) {
13
13
if (age > 18 ) {
14
14
return true ;
15
15
} else {
16
- return confirm (' Do you have your parents permission to access this page ?' );
16
+ return confirm (' Você tem permissão de seus pais para acessar esta página ?' );
17
17
}
18
18
}
19
19
```
20
20
21
- Rewrite it , to perform the same, but without ` if ` , in a single line .
21
+ Reescreva , to perform the same, mas sem ` if ` , em uma única linha .
22
22
23
- Make two variants of ` checkAge ` :
23
+ Faça duas variantes de ` checkAge ` :
24
24
25
- 1 . Using a question mark operator ` ? `
26
- 2 . Using OR ` || `
25
+ 1 . Usando um operador de interrogação ` ? `
26
+ 2 . Usando OR ` || `
You can’t perform that action at this time.
0 commit comments