Skip to content

Conversation

@viveralia
Copy link

Tuvimos problemas para imprimir el mensaje cuando el nombre es el mismo y para imprimir los 'et' en el bonus. 😬

Copy link

@ta-web-mex ta-web-mex 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, 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++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@ta-web-mex ta-web-mex closed this Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants