-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
done #3755
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.
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) { |
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.
if (words.length === 0)
mejor. Utiliza el operador "===" mejor.
Mejor incluso => if (!words.length)
if (words.length == 0) { | ||
return null | ||
} | ||
let notLargest = "" |
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.
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 :<
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) { | ||
} |
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.
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) |
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.
Niceee
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>
|
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. |
Me ha faltado alguna que otra cosa por entender sobre todo los bonus pero por lo demás todo bien. Seguiremos viendo como mejorarlo