-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Update index.js #2686
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
base: master
Are you sure you want to change the base?
Update index.js #2686
Conversation
let hacker1 = "Julio"; | ||
console.log("The driver's name is " + hacker1); | ||
|
||
let hacker2 = "Christian"; |
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.
let hacker2 = "Christian"; | |
const hacker2 = "Cristian"; |
Siempre que puedas const (lo del nombre es coña, pero es que se escribe sin la h jejeje xD)
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.
Cierto!! Cont const!! Y lo de Christian es por que el de mi hermano se escribe con h....deberiais juntaros todos los Chri/Cristians del mundo y aclararos.
@@ -1,7 +1,53 @@ | |||
// Iteration 1: Names and Input | |||
|
|||
let hacker1 = "Julio"; |
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.
let hacker1 = "Julio"; | |
const hacker1 = "Julio"; |
index.js
Outdated
} else if (hacker1.length < hacker2.length) { | ||
console.log("It seems that the navigator has the longest name, it has " + hacker2.length + " characters."); | ||
} else { | ||
console.log("Wow, you both have equally long names, " + hacker1.length + " characters!"); |
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.
console.log("Wow, you both have equally long names, " + hacker1.length + " characters!"); | |
console.log("Wow, you both have equally long names, " + hacker1.length + " characters!"); |
Esto esta perfect pero si tuvieras que usar la interpolacion como lo harias??
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.
Asi jejeje!
console.log(Wow, you both have equally long names, ${hacker1.length} characters!
);
const words = longText.split(" "); | ||
|
||
for (let i = 0; i < words.length; i++) { | ||
const word = words[i].trim(); |
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.
const word = words[i].trim(); | |
const word = words[i]; |
Esto precisamente con el split de antes no te haria falta el trim :D
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.
Me pasa por pecar de listo. Era para asegurame de que no hubiera espacios adicionales al principio o al final del texto. Pero cierto. Está de más ;)
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. |
No description provided.