Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[webptmat0418] - Alma y Rulo (+bonus quest)#361

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ruloalonso wants to merge14 commits intoironhack-labs:masterfromruloalonso:master

Conversation

ruloalonso
Copy link

No description provided.

fontcubertaand others added14 commitsJanuary 10, 2017 17:49
…one" but the test is expecting for the string itself, i change the Readme file wich is the quck fix, but may be could be good to change the spec file to not confuse the student.
…tion-fixthe test are waiting for undefined but the description says false
@ruloalonsoruloalonso changed the titlebonus track!![webptmat0418] - Alma y Rulo (+bonus quest)May 2, 2018
Copy link
Contributor

@ta-web-madta-web-mad left a comment

Choose a reason for hiding this comment

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

Buen trabajo, seguid así! 👍

}else{
returnb;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Es correcto, para ahorrar alguna línea, podéis no poner el else, y dejar el return b, ya que si cumple la condición, sale de la función por el return, y si no, devuelve b. Otra manera de hacer el ejercicio, echadle un ojo a Math.max( )

}
}
returnlongest;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Muy bien!

const reducer = (accumulator, currentValue) => accumulator + currentValue;
return numbers.reduce(reducer);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bien ambas, tanto la manual como la comentada. En el caso de hacerlo con reduce, cuidado con la sobreabstracción. Llamais a una función reducer dentro de reduce dentro de una función. Quizás sea demasiado para algo tan pequeño. Y no utiliceis arrow function todavía, que es ES6 y aún no lo hemos dado en el bootcamp

sum+=word.length;
});
returnsum/words.length;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Muy bien, aquí también podeis usar reduce (o reutilizar el método para sumar que hiciste antes)

}
});
returnresult;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bien hecho. Varias cositas sobre el código. Podéis hacer que itere menos usando un bucle for y haciendo 'return true' cuando cumpla la condición. Y digo for y no forEach, porque el problema de map( ) y forEach( ) es que no dejan de iterar ante un break o un return. Cuando se encuentran con break o return, solo saltan esa iteración y pasan a la siguiente. Así podéis dejar de comprobar más nombres cuando ocurra la condición en vez de iterar sobre todos los nombres independientemente de que se cumpla la condición.

}
}
returncount;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Genial, también podéis usar indexOf( ) o includes( ), echadle a cómo hacerlo con ambos

}

greatestProduct(matrix);

Copy link
Contributor

Choose a reason for hiding this comment

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

Muy bien, es correcto. Solo puedo poner una pega, es muy largo incluso sin los console log, cómo lo podríais hacer más corto?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
1 more reviewer

@ta-web-madta-web-madta-web-mad approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@ruloalonso@ta-web-mad@mc100s@fontcuberta@nizaroni@papuarza@HectorBlisS

[8]ページ先頭

©2009-2025 Movatter.jp