Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
fdurban wants to merge1 commit intoironhack-labs:masterfromfdurban:master
Closed

done#3755

fdurban wants to merge1 commit intoironhack-labs:masterfromfdurban:master

Conversation

fdurban
Copy link

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

@0xThales0xThales 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 deif (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 commentedApr 14, 2023 via email

Gracias Dan!El vie., 14 abr. 2023 16:11, Daniel Jimenez ***@***.***>escribió:
***@***.**** commented on this pull request. Buen trabajo! Te dejo unos cuantos comentarios del lab ------------------------------ In src/functions-and-arrays.js <#3755 (comment)> : > // Iteration#2: Find longest word const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot']; +function findLongestWord(words) { + if (words.length == 0) { if (words.length === 0) mejor. Utiliza el operador "===" mejor. Mejor incluso => if (!words.length) ------------------------------ In src/functions-and-arrays.js <#3755 (comment)> : > // Iteration#2: Find longest word const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot']; +function findLongestWord(words) { + if (words.length == 0) { + return null + } + let notLargest = "" 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 :< ------------------------------ In src/functions-and-arrays.js <#3755 (comment)> : > + 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) { + } 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) ------------------------------ In src/functions-and-arrays.js <#3755 (comment)> : > // Iteration#6: Find elements const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience']; -function doesWordExist() {} - +function doesWordExist(wordsFind, wordToSearch) { + if (wordsFind.length == 0) { + return null; + } + return wordsFind.includes(wordToSearch) Niceee — Reply to this email directly, view it on GitHub <#3755 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A65ZLTTTGCAUAUIXP2ELHD3XBFLI5ANCNFSM6AAAAAAW5TJCIE> . You are receiving this because you authored the thread.Message ID: <ironhack-labs/lab-javascript-functions-and-arrays/pull/3755/review/1385538149 @github.com>

@stale
Copy link

stalebot commentedMay 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.

@stalestalebot added the stale labelMay 16, 2023
@stale
Copy link

stalebot commentedJun 7, 2023

This pull request is closed. Thank you.

@stalestalebot closed thisJun 7, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@0xThales0xThales0xThales left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@fdurban@0xThales

[8]ページ先頭

©2009-2025 Movatter.jp