-
Notifications
You must be signed in to change notification settings - Fork 5.8k
PP-WDFT-MEX-ALEJANDRA-OCHOA-ISRAEL-SANCHEZ #619
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
Conversation
ta-web-mex
left a comment
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.
Muy buen ejercicio chicos! Pongan un poco más de atención a los detalles y siempre busquen en google como otros solucionan los problemas de los labs para que su apredizaje no se quede únicamente en la clase, si no que prueben cosas nuevas y se empapen de código en el bootcamp.
Sigan así! 👏
| const hacker1 = "Ale" | ||
| console.log("The driver's name is "+hacker1) | ||
| const hacker2 = "Israel" | ||
| console.log("The navigator's name is "+hacker1) |
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í dejaron hacker1 como nombre de navigator
| console.log('The driver has the longest name, it has' +hacker1.length+" characters.") | ||
| } | ||
| else{ | ||
| if(hacker1.length==hacker2.length) |
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.
| } | ||
|
|
||
| // Iteration 3: Loops No newline at end of file | ||
| // Iteration 3: Loops |
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.
Para esta iteración pudieron haber usado un método de los strings de JS que se llama localeCompare() que regresa 1, 0 o -1 dependiendo del orden lexicográfico de las palabras o cero si son iguales.
|
|
||
| let phraseToCheck = "Amor, Roma" | ||
| let phrase=phraseToCheck | ||
| phraseToCheck=phraseToCheck.replace(" ","") |
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.
Para usar replace() con todos los casos que escribieron línea por línea, pudieron haber utilizado una expresión regular (regex) para incluir todos esos elementos en el primer parámetro del método y reemplazarlos por un espacio. En este momento puede parecer un poco avanzado pero les dejo liga a una introducción a regex de MDN para que le echen un ojo si quieren :)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

En el bonus 2 sólo consideramos acentos, espacios y los caracteres especiales: ¿ ? ! ¡ ,
Quisimos hacerlo nosotros solos, pero podríamos buscar otras soluciones en google. :)