-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Ber-FT]Finished Sebastian - Martin #629
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
| hacker2Backwards += hacker2[i - 1]; | ||
| } | ||
| console.log(hacker2Backwards); | ||
|
|
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.
All good in the hood!
A small comment:
For the reverse loop, instead of doing hacker2[i-1] you could change it in for (let i = hacker2.length - 1; i >= 0; i--);
which in terms of common practice in js would be that way, but it still works and there is no problem with your code.
Another small note: When naming variables for loops such as "let i" remember you can use other names for the variables in the loops such as "let j".
| console.log("number of et: " + counter); | ||
| console.log("number of words: " + wordCounter); | ||
|
|
||
|
|
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.
Nice job guys!
I guess you guys were counting "of" instead of "et" but looks like you got the idea of the lab.
A small note on the "of" counter: If there was a word like "software" your counter will count it as an extra "of" when actually there isn´t. So a small correction would be to make sure there is a space after the "f" in your code
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.
That's actually what we went for, we decided that we should count every "of" regardless if it is found in word or by itself.
I guess we could do if (words[i] == "o" && words[i + 1] == "f" && words[i + 1] == " ") . right?
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.
Or should it actually be : if (words[i] == "o" && words[i + 1] == "f" && words[i + 2] == " ") . ?
|
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. |
|
This pull request is closed. Thank you. |
No description provided.