Skip to content

BER_FT_03_23_23_HeimLi #3683

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

Closed
wants to merge 1 commit into from
Closed

BER_FT_03_23_23_HeimLi #3683

wants to merge 1 commit into from

Conversation

HeimLi
Copy link

@HeimLi HeimLi commented Mar 23, 2023

No description provided.

if (num1 > num2) { return num1 }
else { return num2 }
}
result = maxOfTwoNumbers(3, 5);

Choose a reason for hiding this comment

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

You don't need to call your function here to make it work. If you use it, to test your code, that's fine! 😉 But you should better remove these function calls before you submit the lab.

//console.log(typeof (wordLength));

for (let i = 0; i < words.length; i++) {
if (wordLength.length < words[i].length) {

Choose a reason for hiding this comment

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

Better store the longest word in a string, not an array and just compare the length by using longestWord.length

return averageNumbersSum/2
}

let result4 = averageNumbers(numbersAvg);

Choose a reason for hiding this comment

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

You should divide the total sum by the amount of numbers in the array to get the average


for (let i = 0; i < wordsUnique.length; i++) {

if (newArray.includes(wordsUnique[i])) {

Choose a reason for hiding this comment

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

You could also check if the array doesn't include the word by using !newArray.includes(wordsUnique[i]), then you don't need an else


for (let i = 0; i < wordsFind.length; i++) {
if (wordsFind.includes(givenWord)) {
console.log("true"); break

Choose a reason for hiding this comment

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

Good solution, you just need to replace the console.log with a return-statement

howManyTimes,
greatestProduct
};
}

Choose a reason for hiding this comment

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

Good solutions! ✨ Keep on the good work!

@HeimLi
Copy link
Author

HeimLi commented Mar 28, 2023 via email

@stale
Copy link

stale bot commented May 22, 2023

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 May 22, 2023
@stale
Copy link

stale bot commented May 31, 2023

This pull request is closed. Thank you.

@stale stale bot closed this May 31, 2023
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