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
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 ` é maior que ` 18 ` .
88
9- Otherwise it asks for a confirmation and returns its result .
9+ Caso contrário, pede por uma confirmação e retorna seu resultado .
1010
1111``` js
1212function checkAge (age ) {
1313 if (age > 18 ) {
1414 return true ;
1515 } 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 ?' );
1717 }
1818}
1919```
2020
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 .
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 um operador de interrogação ` ? `
26+ 2 . Usando OR ` || `
You can’t perform that action at this time.
0 commit comments