-
-
Notifications
You must be signed in to change notification settings - Fork 41
NW6 | Fikret Ellek | JS-2-Module | Week-1 #183
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cute-gaufre-e4b4e5 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Great work @fikretellek !
Have a look at the feedback I left for your and try to implement them here and use it in your next tasks.
Thanks
} else { | ||
median = (sortedList[middleIndex] + sortedList[middleIndex - 1]) / 2; | ||
} | ||
|
||
return median; |
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 work!
return list; | ||
} else { | ||
let dedupedList = []; | ||
for (let x of list) { |
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.
Can you please rename the x
variable with a meaningful name?
function maxNum(list) { | ||
let maximum = -Infinity; | ||
for (let x of list) { | ||
if (x > maximum && !x.isNaN) { |
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.
Also, x is not really useful you should make all your functions and variables more meaningful.
if (list.length === 0) { | ||
return 0; | ||
} else { | ||
let sumOfNum = 0; |
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.
Is good practice to declare your variables at the top at the beginning of the function. SO can you remove the sumOfNum var to line 2?
Learners, PR Template
Self checklist
Changelist
Week 1's work is done.
Questions
Ask any questions you have for your reviewer.