Glasgow | 25-ITP-SEP | Mohammed Abdoon | Sprint 1| Sprint-1#799
Glasgow | 25-ITP-SEP | Mohammed Abdoon | Sprint 1| Sprint-1#799M-Abdoon wants to merge 8 commits intoCodeYourFuture:mainfrom
Conversation
AbogeJr
left a comment
There was a problem hiding this comment.
Good work overall. Please check out the comments and resubmit for review.
| } | ||
| } | ||
| return false; | ||
| const includes = (list, target) =>{ |
There was a problem hiding this comment.
While this may work in most JS environments, could you double check the for...of syntax and see if ther is a better way to write this.
There was a problem hiding this comment.
I got it. I didn't declare the variable 'item' properly. I should have put 'let' or 'const' before the variable. It works, but the code fails when running in strict mode ( "use strict"; ). It is safer to declare it the right way. I updated the code so the for..of syntax is better and safer.
Sprint-1/fix/median.js
Outdated
| return null; | ||
|
|
||
| // filter out non-numeric values inside the list | ||
| list = list.filter(item => Number.isInteger(item)); |
There was a problem hiding this comment.
Good stuff. You’re currently using Number.isInteger() to check numbers. Could there be a better way to include floating-point numbers in your median calculation too?
There was a problem hiding this comment.
Yes, will be better to use Number.isFinite() instead of Number.isInteger if we want to include floating-point numbers.
I updated filter() so floating-point numbers are included.
| @@ -1 +1,7 @@ | |||
| function dedupe() {} | |||
| function dedupe(arr) { | |||
| arr = new Set(arr); // Using `new Set()` to store only unique values in the same variable | |||
Thank you so much for the review. I updated the code and made changes. |
|
Your PR couldn't be matched to an assignment in this module. Please check its title is in the correct format, and that you only have one PR per assignment. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Nice work with the changes👍🏾. There might be a small issue with your PR title though. Please check it out and make sure it strictly follows the format. After that you should be all done. |
Thank you so much. I updated the PR's title. |
Learners, PR Template
Self checklist
Changelist
I've done the Sprint 1 exercises. including fixing, implementing and refactoring code.
Questions
No questions so far, thank you.