-
Notifications
You must be signed in to change notification settings - Fork 6.7k
WDFT REMOTE MAR22 Fevi #2932
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
WDFT REMOTE MAR22 Fevi #2932
Conversation
num += number; | ||
} | ||
return num / numbersAvg.length; | ||
}; | ||
|
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.
Really good work, Fevi!
const wordsArr = ['seat', 'correspond', 'linen', 'motif', 'hole', 'smell', 'smart', 'chaos', 'fuel', 'palace']; | ||
|
||
function averageWordLength() { } | ||
averageWordLength = wordsArr.join('').length / wordsArr.length | ||
console.log(averageWordLength); | ||
|
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.
I think here you just had a wrong thinking, if you look at the solution in the Student Portal, then you will understand it quickly!
]; | ||
|
||
function uniquifyArray() {} | ||
function uniquifyArray(wordsUnique) { | ||
const uniqueArray = []; | ||
|
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.
here you miss the if condition:
if (wordsUnique.length == 0){
return null
}
|
||
const uniqueNames = uniquifyArray(wordsUnique); | ||
console.log(uniqueNames); | ||
|
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.
For the last tasks I would say: look at the solution in your own time and if you have any questions, ask Karina, Marian or me (Joanne).
function doesWordExist(wordsFind, word) { | ||
if (wordsFind.length === 0) return null; | ||
for (let el of wordsFind) { | ||
if (el === 'disobedience') return true; |
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.
But one more thing: you never know which words you really have in the array. So you can't compare with specific words. It should work for any array of words.
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. |
I couldn't solve Iteration #4 Level 2 with a function.
Iteration #5 was also a bit tricky.