-
Notifications
You must be signed in to change notification settings - Fork 5
Exercicios Zé/Camila #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| function categoria(cursos, categoria) { | ||
|
|
||
| return cursos.filter((cursos) => { | ||
| if(cursos.categoria == categoria){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== ou === ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A função que passamos para o filter deve retornar um valor booleano (true ou false). Porque vocês retornaram cursos?
|
|
||
| function duracaoMaiorQue(cursos, duracao) { | ||
|
|
||
| return cursos.filter((cursos) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cursos.filter((cursos) -> aqui vc pode dar qualquer nome, mas cursos, no plural, me parece não estar coeso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Além disso é uma má prática fazer um shadow de variáveis.
https://stackoverflow.com/questions/11901427/an-example-of-variable-shadowing-in-javascript
| return new Promise (function(resolve, reject){ | ||
| if(carro == 'golf'){ | ||
| resolve(true) | ||
| } else if(carro == undefined){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e se eu passar null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bateria de testes precisa ser melhorada...
| function nomeComAprovacao (pessoas, notaParaAprovacao = 8) { | ||
|
|
||
| return pessoas.map((pessoas) => { | ||
| if(pessoas.nota > notaParaAprovacao){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
como faria com template string?
e com ternário?
| } | ||
|
|
||
| function alunos(pessoas) { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
não precisa desse JSON.parse(JSON.stringify(
| function duracaoMenorQue(cursos, duracao) { | ||
|
|
||
| return cursos.filter((cursos) => { | ||
| if(cursos.duracao < duracao){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A função que passamos para o filter deve retornar um valor booleano (true ou false). Porque vocês retornaram cursos?
| function comProfessor(cursos) { | ||
|
|
||
| return cursos.filter((cursos) => { | ||
| if(cursos.professor){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A função que passamos para o filter deve retornar um valor booleano (true ou false). Porque vocês retornaram cursos?
| function semProfessor(cursos) { | ||
|
|
||
| return cursos.filter((cursos) => { | ||
| if(!cursos.professor){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A função que passamos para o filter deve retornar um valor booleano (true ou false). Porque vocês retornaram cursos?
| return new Promise (function(resolve, reject){ | ||
| if(carro == 'golf'){ | ||
| resolve(true) | ||
| } else if(carro == undefined){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Porque esse teste de undefined?
| function alunos(pessoas) { | ||
|
|
||
| return pessoas.map((pessoas) => JSON.parse(JSON.stringify({ primeiroNome: pessoas.nome, notaFinal: pessoas.nota }))); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Porque esse uso de JSON aqui?
| function categoria(cursos, categoria) { | ||
|
|
||
| return cursos.filter((cursos) => { | ||
| if(cursos.categoria == categoria){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A função que passamos para o filter deve retornar um valor booleano (true ou false). Porque vocês retornaram cursos?
No description provided.