---
title: "Discussion on \"How to Keep Track of Counts in an Array\" | Hashnode"
description: "Discussion on \"How to Keep Track of Counts in an Array\". Here is the instruction for the coding exercise:\nCreate a function that takes in an array of numbers and returns an object in the specified format based on their counts.\nInput array: [1, 2, 3, 3, 4, 3, 2, 4, 4, 5, 4]\n\nExpected return: \n{\n  unique: [1..."
url: "https://hashnode.com/posts/how-to-keep-track-of-counts-in-an-array/68ea630128e8d3cab61baa9e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Keep Track of Counts in an Array](https://uidev.net/how-to-keep-track-of-counts-in-an-array?utm_source=hashnode&utm_medium=feed)

Here is the instruction for the coding exercise: Create a function that takes in an array of numbers and returns an object in the specified format based on their counts. Input array: \[1, 2, 3, 3, 4, 3, 2, 4, 4, 5, 4\] Expected return: { unique: \[1...

Oct 11, 2025 · 2 min read · uidev.net  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#howtos](https://hashnode.com/tag/howtos)

## Written by

[Ying](https://hashnode.com/@ying)

@ying · Austin, TX

  
[View profile](https://hashnode.com/@ying)

Founder @ Rao Ventures

Crafting delightful applications with #React #ReactNative #NextJS #TypeScript #GraphQL

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
