London | 26-ITP-Jan | Alex Okorefe | sprint 2 | coursework#1194
Open
Alex-Os-Dev-Lab wants to merge 24 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-Jan | Alex Okorefe | sprint 2 | coursework#1194Alex-Os-Dev-Lab wants to merge 24 commits intoCodeYourFuture:mainfrom
Alex-Os-Dev-Lab wants to merge 24 commits intoCodeYourFuture:mainfrom
Conversation
…ts, existing properties, non-existent properties, arrays, and null/undefined inputs
…sure proper decoding of keys and values
…duplicate items, and invalid inputs
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cjyuan
reviewed
Apr 23, 2026
Comment on lines
+7
to
+8
| // 2. Check if the propertyName exists as a key in the object | ||
| return propertyName in obj; |
Contributor
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.
Comment on lines
+7
to
+12
| const counts = {}; | ||
|
|
||
| for (const item of items) { | ||
| // If the item exists, increment; otherwise, initialize to 1 | ||
| counts[item] = (counts[item] || 0) + 1; | ||
| } |
Contributor
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()
…e counts with Object.create(null) in tally function
Contributor
|
Changes look good. |
Author
|
Cheers CJ 😅
At this point I thought I was going to hear otherwise 😌
…________________________________
From: CJ Yuan ***@***.***>
Sent: 23 April 2026 22:47
To: CodeYourFuture/Module-Data-Groups ***@***.***>
Cc: Alex-Os-Dev-Lab ***@***.***>; Author ***@***.***>
Subject: Re: [CodeYourFuture/Module-Data-Groups] London | 26-ITP-Jan | Alex Okorefe | sprint 2 | coursework (PR #1194)
[https://avatars.githubusercontent.com/u/7696139?s=20&v=4]cjyuan left a comment (CodeYourFuture/Module-Data-Groups#1194)<#1194?email_source=notifications&email_token=B42Z7BKW5OQ4VWTQN3FNZDL4XKFPFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMZQHA2DGMJQGUY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2LK4DSL5RW63LNMVXHIX3POBSW4X3DNRUWG2Y#issuecomment-4308431051>
Changes look good.
—
Reply to this email directly, view it on GitHub<#1194?email_source=notifications&email_token=B42Z7BKW5OQ4VWTQN3FNZDL4XKFPFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMZQHA2DGMJQGUY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2LK4DSL5RW63LNMVXHIX3POBSW4X3DNRUWG2Y#issuecomment-4308431051>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B42Z7BIDQ2KQK7ASBE3IIPD4XKFPFAVCNFSM6AAAAACXU224OGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DGMBYGQZTCMBVGE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Completed Assignments related to Data Groups Sprint-2
Questions
None for now