File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
1-js/02-first-steps/14-function-basics/2-rewrite-function-question-or Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- Using a question mark operator ` '?' ` :
1+ Usando operador de interrogação ` '?' ` :
22
33``` js
44function 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
1212function 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 readabilty .
17+ Note que os parêntesis em volta de ` age > 18 ` não são obrigatórios aqui. Eles existem para melhor legibilidade .
You can’t perform that action at this time.
0 commit comments