Skip to content
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

ejercicios dia 2 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ejercicios dia 2 #30

wants to merge 1 commit into from

Conversation

AndresO90
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@totegsito totegsito left a comment

Choose a reason for hiding this comment

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

¡Muy buen trabajo! Te he puesto un par de comentarios sólo 😄 échales un ojo

@@ -0,0 +1,9 @@

const isEven = number => {
if(number % 2 === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Aquí un return number % 2 === 0 también te valdría

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Muy cierto xD

} else if (operator === 'multiply') {
number = n1 * n2;
} else {
number = n1 / n2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Según esto, si yo paso como operador "suma" me hará una división 😅

@@ -0,0 +1,10 @@
const maxDivider = (divider, limit) => {
for(let i = divider; i > 0; i--) {
if(divider % i === 0 && i < limit) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Creo que aquí has mezclado cosas, me explico, el límite sería el que debería marcar tu for, no el divisor 😅 Además, el divisor siempre debería ser será menor que límite, por lo que la segunda condición siempre se va a cumplir 😅

const daysToGrow = (growSpeed, decreaseSpeed, desiredHeight) => {
let daysToGoal = 0;
let grow = 0;
for(daysToGoal; daysToGoal <= desiredHeight; daysToGoal++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Aunque los informáticos contamos empezando por 0 siempre, esto es pensado para personas que cuentan desde el 1 ;-)

Muy buena solución igualmente 😄


switch(selectedDay) {
case "lunes":
message = number === 12 ? `Es Lunes y odio el número ${number}` : notHatedMsg;
Copy link
Collaborator

Choose a reason for hiding this comment

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

¡Oído cocina! 😆

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.

2 participants