Repository navigation
London | 26-ITP-Sep | Chandramani Gaire | Sprint 2 | Module-Data-Group - #1515
gaireprakash20-ops wants to merge 14 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
gaireprakash20-ops
left a comment
There was a problem hiding this comment.
please review this file
| if (decodedKey in queryParams) { | ||
| if (Array.isArray(queryParams[decodedKey])) { | ||
| queryParams[decodedKey].push(decodedValue); | ||
| } else { | ||
| queryParams[decodedKey] = [queryParams[decodedKey], decodedValue]; |
There was a problem hiding this comment.
What happens when a query string contains a key such as toString or __proto__? Does in here distinguish keys already parsed from properties inherited by queryParams?
To "like" or "dislike" this comment, please follow this link
| test("contains on empty object returns false", () => { | ||
| expect(contains({}, "name")).toBe(false); | ||
| }); |
There was a problem hiding this comment.
Now that this case has an implementation test, what will Jest still report from the earlier test.todo? The same leftover TODO is present in lookup.test.js.
To "like" or "dislike" this comment, please follow this link
| // ==>It turns an object into an array of [key, value] pairs. Object.entries({ a: 1, b: 2 }) gives [["a", 1], ["b", 2]]. It’s needed because a for...of loop can’t go through a plain object directly, and the function needs both the key and the value of each property. Object.entries provides both, and const [key, value] unpacks each pair. | ||
| // d) Explain why the current return value is different from the target output | ||
|
|
||
| // ==>first it used the dot notation instead of square bracket which is accessing the property using a literal name |
There was a problem hiding this comment.
Does the issue with invertedObj.key come from dot notation itself, or from which property name that expression accesses?
To "like" or "dislike" this comment, please follow this link
|
The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look. |
Learners, PR Template
Self checklist
Task code
CYF-1083
Changelist
I have done all the course work and created new file for the Invert.js ans have pushed it along with the rest of file