PP FT MEX - Juan Vidal && Edgar Viveros - #469
Conversation
ta-web-mex
left a comment
There was a problem hiding this comment.
Buen trabajo, llegaron a los bonuses! Recuerden buscar en MDN (or just Google it) lo que tengan duda antes de intentar solucionarlo, ahorra tiempo y esfuerzo. 🌵
| .join('') | ||
| ) | ||
|
|
||
| for (let i = 0; i < hacker1.length; i++) { |
There was a problem hiding this comment.
Busquen en MDN el método localeCompare(). Cuando no sepan como analizar strings o arrays, primero búsquen en Google. Pasa seguido que queremos hacer nosotros las comparaciones cuando hay métodos del lenguaje que facilitan esto mismo. Les ahorrará mucho tiempo después :)
| let etCounter = 0 | ||
| let word = 'et' | ||
|
|
||
| for (let i = 0; i < text.length; i++) { |
There was a problem hiding this comment.
Same here. El método split() regresa un array que pone un nuevo elemento en el array cada que se repite un caracter, por lo que utilizar length sobre el array que regresa split y restándole uno (porque los arrays empiezan en 0) obtienes el numero de elementos en el string.
let et = text.split(',').length - 1
console.log(et)
Tuvimos problemas para imprimir el mensaje cuando el nombre es el mismo y para imprimir los 'et' en el bonus. 😬