- Notifications
You must be signed in to change notification settings - Fork6.7k
[PTMAD102022] DANIEL OLEA GARCIA#3404
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
marco238 commentedNov 5, 2022
hola Daniel! Te dejo algo de feedback en el código. Pero en general muy buen trabajo!!! 🚀 |
marco238 commentedNov 5, 2022
Por el bonus ni te preocupes! Buen trabajo!!! |
} | ||
for (let i = 0 ; i < wordsFind.length ; i++){ | ||
if (!wordsFind[i].includes(word)){ | ||
return false; |
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í lo que te está pasando es que en la primera iteración del "for", estás haciendo un return que termina la función y deja de analizar el resto de iteraciones.
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.
intenta con una variable auxiliar que empiece siendo "false":
function doesWordExist(wordsFind, word) { if (wordsFind.length === 0) { return null; } let exists = false; for (let i = 0 ; i < wordsFind.length ; i++){ if (wordsFind[i].includes(word)){ exists = true; } } return exists;}
This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
1 similar comment
This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request is closed. Thank you. |
Ejercicio resuelto menos una parte del#6 y bonus final