Sheffield | 26-Jan-ITP | Martha Ogunbiyi| Sprint 2| Coursework/sprint 2#1133
Sheffield | 26-Jan-ITP | Martha Ogunbiyi| Sprint 2| Coursework/sprint 2#1133marthak1 wants to merge 15 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Changes look good. Just one more question.
| obj === null || | ||
| typeof obj !== "object" || | ||
| Array.isArray(obj) || | ||
| Object.getPrototypeOf(obj) !== Object.prototype |
There was a problem hiding this comment.
What is the purpose of the condition on line 6?
There was a problem hiding this comment.
Thanks for feedback. Line 6 ensures the function also reject non plain objects like Map, Set , Date etc.
There was a problem hiding this comment.
What about an empty object created from Object.create(null)? Do you plan to reject that kind of object as well?
Note: Prototype is a relatively advanced concept in JS programming. If you have to use it, use it with care.
There was a problem hiding this comment.
Thanks for the feedback, I never thought about about objects created with no prototypes at all on this case. function has now been updated.
|
All good. |
Learners, PR Template
Self checklist
Changelist
Sprint 2 coursework done