Skip to content

Conversation

@jcestaro
Copy link

No description provided.

function categoria(cursos, categoria) {

return cursos.filter((cursos) => {
if(cursos.categoria == categoria){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== ou === ?

Copy link
Owner

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) => {

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

Copy link
Owner

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){

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?

Copy link
Owner

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){

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) {

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){
Copy link
Owner

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){
Copy link
Owner

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){
Copy link
Owner

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){
Copy link
Owner

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 })));
}
Copy link
Owner

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){
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants