London | 26-ITP-May | Anita Amirhaeri | Sprint 2 | Module-data-group - #1390
London | 26-ITP-May | Anita Amirhaeri | Sprint 2 | Module-data-group#1390anitahy73 wants to merge 12 commits into
Conversation
Updated recipe logging to display ingredients on separate lines.
Implemented the createLookup function to build a lookup object from country-currency pairs.
Refactor parseQueryString to handle empty pairs and decode keys/values.
Removed optional test for handling identical keys in query strings.
| if (obj === null || typeof obj !== "object" || Array.isArray(obj)) { | ||
| return false; | ||
| } | ||
| return property in obj; |
There was a problem hiding this comment.
Consider the following two approaches for determining if an object contains a property:
let obj = {}, propertyName = "toString";
console.log( propertyName in obj ); // true
console.log( Object.hasOwn(obj, propertyName) ); // false
Which of these approaches suits your needs better?
For more info, you can look up JS "in" operator vs Object.hasOwn.
| @@ -1,3 +1,15 @@ | |||
| function tally() {} | |||
| function tally() { | |||
| const counts = {}; | |||
There was a problem hiding this comment.
Does the following function call returns the value you expect?
tally(["toString", "toString"]);
Suggestion:
- Look up an approach to create an empty object with no inherited properties, or
- use
Object.hasOwn()
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: 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). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
1 similar comment
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: 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). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
You might have accidently "saved" |
Learners, PR Template
Self checklist
Changelist
Sprint 2 | Module-data-group
Questions