- Notifications
You must be signed in to change notification settings - Fork6.7k
[webptmad0418] Paula y Alejandro#369
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Removed duplicated text
Extra Resources added
…with-teststarter-code-with-tests
…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
…rd-fixfind-longest-word-little-fix
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.
Buen ejercicio, echadle un ojillo a lo que os he ido comentado. Buen trabajo! 👍
else { | ||
return 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.
El resultado está bien, pero hay demasiados condicionales ahí, os valdría solo con el primer if
preview = next; | ||
} | ||
return preview; | ||
}) |
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.
Bien pensado, aunque pierde un poco el sentido reduce si no usas dicha el acumulador como acumulador
var numSum = numbers.reduce((prev, cur) => prev + cur, 0); | ||
return numSum; | ||
} | ||
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.
Es correcto, peeeeeeero, no me uséis arrow functions en el callback y ponedme el return del callback, porque aún no hemos llegado a esa parte
arr = arr.map(words => words.length); | ||
var average = arr.reduce((prev, next) => prev + next); | ||
average = average / arr.length; | ||
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.
Por qué utilizáis map( ) y luego reduce( )? Mejor usad una variable que vaya acumulando los valores dentro del map en vez de usar reduce después del map. Si hacéis map y luego reduce hacéis dos bucles en vez de uno solo si utilizáis una variable sumatoria en el map
return newUnuniquifyArray; | ||
} | ||
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.
No entiendo tampoco vuestro uso de filter aqui, no es necesario, con un bucle y el indexOf( ) vale, no hace falta poner funciones que tienen más mecánicas de fondo que no se van a utilizar.
@@ -60,6 +138,11 @@ var wordsFind = [ | |||
'disobedience' | |||
]; | |||
function doesWordExist(wordsArray, word) { | |||
return wordsArray.some(item => item === word); | |||
} |
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.
Correcto, pero no arrow functions y quered un poco más a los returns, que más adelante os van a dar problemas si no los ponéis
}); | ||
return count; | ||
} | ||
} |
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.
Es correcto. El else no es necesario y podíais haber usado filter( ) junto con length( ) para resolver este ejercicio
} | ||
} | ||
return greatestVerticalProduct; | ||
} |
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 bien, es correcto, además no es muy largo. Podríais hacerlo solo con dos bucles?
No description provided.