Skip to content

done #3755

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

Closed
wants to merge 1 commit into from
Closed

done #3755

wants to merge 1 commit into from

Conversation

fdurban
Copy link

@fdurban fdurban commented Apr 13, 2023

Me ha faltado alguna que otra cosa por entender sobre todo los bonus pero por lo demás todo bien. Seguiremos viendo como mejorarlo

Copy link

@0xThales 0xThales 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! Te dejo unos cuantos comentarios del lab




// Iteration #2: Find longest word
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
function findLongestWord(words) {
if (words.length == 0) {

Choose a reason for hiding this comment

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

if (words.length === 0) mejor. Utiliza el operador "===" mejor.
Mejor incluso => if (!words.length)

if (words.length == 0) {
return null
}
let notLargest = ""

Choose a reason for hiding this comment

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

longestWord sería un mejor nombre para esta variable. Al fin y al cabo, se trata precisamente de la palabra más larga. notLargest es precisamente lo contrario :<

Comment on lines +55 to +63
for (let i = 0; i < numbers.length; i++) {
if (typeof numbers[i] === String) {
return sumOfNumbersAndOthers += numbers[i]
}
if (typeof numbers[i] === Number) {
return sumOfNumbersAndOthers += numbers.length
}
if (typeof numbers[i] === Boolean) {
}

Choose a reason for hiding this comment

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

typeof devuelve una string. typeof 5 === "number"
Así que estos condicionales nunca van a cumplirse :(

if (typeof numbers[i] === "string") sería correcto en vez de if (typeof numbers[i] === String)

if (wordsFind.length == 0) {
return null;
}
return wordsFind.includes(wordToSearch)

Choose a reason for hiding this comment

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

Niceee

@fdurban
Copy link
Author

fdurban commented Apr 14, 2023 via email

@stale
Copy link

stale bot commented May 16, 2023

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.

@stale stale bot added the stale label May 16, 2023
@stale
Copy link

stale bot commented Jun 7, 2023

This pull request is closed. Thank you.

@stale stale bot closed this Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants