Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@MngSebastian
Copy link

No description provided.

@MngSebastian MngSebastian changed the title Finished Sebastian - Martin [Ber-FT]Finished Sebastian - Martin Jan 7, 2020
hacker2Backwards += hacker2[i - 1];
}
console.log(hacker2Backwards);

Copy link

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);


Copy link

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

Copy link
Author

@MngSebastian MngSebastian Jan 7, 2020

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?

Copy link
Author

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] == " ") . ?

@stale
Copy link

stale bot commented Feb 6, 2020

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.

@stale stale bot added the stale label Feb 6, 2020
@stale
Copy link

stale bot commented Feb 8, 2020

This pull request is closed. Thank you.

@stale stale bot closed this Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.