-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: master
Are you sure you want to change the base?
ejercicios dia 2 #30
Conversation
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.
¡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) { |
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.
Aquí un return number % 2 === 0
también te valdría
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.
Muy cierto xD
} else if (operator === 'multiply') { | ||
number = n1 * n2; | ||
} else { | ||
number = n1 / n2; |
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.
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) { |
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.
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++) { |
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.
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; |
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.
¡Oído cocina! 😆
No description provided.