Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

BarbieriMatheus
Copy link

No description provided.

@BarbieriMatheus BarbieriMatheus changed the title [SAO FT2 - DL - W1D3 [SAO FT2 - DL - W1D3] Matheus Barbieri Jan 10, 2019

} while(indice !== -1);

return itera.toString();

Choose a reason for hiding this comment

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

Sempre vai retornar 0 porque a primeira palavra "machine" só ocorre 1 vez no array, logo, o valor de value na linha 152 vai ser -1 (porque o indexOf vai buscar a ocorrência de "machine" a partir do índice 0 e não vai encontrar). Com value = -1, o programa sai do while e retorna 0.

Copy link

@thebinaryfelix thebinaryfelix left a comment

Choose a reason for hiding this comment

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

Boa!

#checked

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