<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf" -->

---
title: Why do you need to know about Array-like Objects?
description: In this article, we will learn about JavaScript array-like objects and how to deal with them. In JavaScript, objects are used to store multiple values as a...
canonical: https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why do you need to know about Array-like Objects? | daily.dev
og:description: In this article, we will learn about JavaScript array-like objects and how to deal with them. In JavaScript, objects are used to store multiple values as a...
og:url: https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf
og:image: https://api.daily.dev/og/posts/wupufvKGf.png
og:image:alt: Why do you need to know about Array-like Objects?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why do you need to know about Array-like Objects?

**[daily.dev](https://daily.dev/sources/daily)** · [@atapas](https://daily.dev/atapas) · 11 upvotes · 4 comments

## Summary

In this article, we will learn about JavaScript array-like objects and how to deal with them. In JavaScript, objects are used to store multiple values as a complex data structure. An Array-like is not constructed by Array or with an Array literal []. Hence it won't inherit anything from Array.prototype.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects>

## Community discussion

Top comments from developers on daily.dev.

**@iaros** · 2 upvotes

> Hmm... Thank you. It was very useful.

**@atapas** · 2 upvotes

> Array-like objects may surprise you at times if you do not recognize them. I have compiled some of my experiences in dealing with them.
>
>
> Please have a look at this article and let me know what do you think about it.

**@saravana\_sai** · 1 upvotes

> const arrayLikePrototype = {
>   forEach(callback) {
>     [...this].forEach((item, index) => {
>       callback(item, index);
>     });
>   },
> };
>
>
>
> ![image](https://res.cloudinary.com/daily-now/image/upload/s--c86wdzzv--/f_auto/v1711891200/ugc/content_9593970e-567b-45d9-9aa5-959507a79b87)
>
>
>
> Object.assign(Object.prototype, arrayLikePrototype);
>
> function checkArgs() {
>   arguments.forEach(function (item, index) {
>     console.log(index [${index}] value [${item}]);
>   });
> }
>
> checkArgs(1, 45, 55);
>
> In addition. We could add our methods to object prototypes & we can access those as native array methods as...

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Why do you need to know about Array-like Objects?","url":"https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf"},"datePublished":"2020-10-23T12:25:09.751Z","dateModified":"2021-10-07T14:17:10.317Z","description":"In this article, we will learn about JavaScript array-like objects and how to deal with them. In JavaScript, objects are used to store multiple values as a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/70917ac7c4e3f590f6e0e6f622f46dfd","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/70917ac7c4e3f590f6e0e6f622f46dfd","isAccessibleForFree":true,"articleSection":"daily.dev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Tapas Adhikary","url":"https://daily.dev/atapas","image":"https://lh3.googleusercontent.com/a-/AOh14GhN71PeWrtSoinbdnOhZS9usr2nbP111YlpswhWaBg=s100","description":"Teacher | YouTuber | Founder ReactPlay & tapaScript | Co-Founder CreoWis | Open Source","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":10210}},"commentCount":4,"discussionUrl":"https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":11},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"keywords":"javascript"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"daily.dev","item":"https://daily.dev/sources/daily"},{"@type":"ListItem","position":3,"name":"Why do you need to know about Array-like Objects?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/why-do-you-need-to-know-about-array-like-objects--wupufvkgf","comment":[{"@type":"Comment","text":"Hmm… Thank you. It was very useful.","datePublished":"2020-10-23T17:23:52.074Z","url":"https://daily.dev/posts/wupufvKGf#c-JQX4lyoEM","author":{"@type":"Person","name":"Iaroslav","url":"https://daily.dev/iaros","image":"https://lh3.googleusercontent.com/a-/AAuE7mBael5pTvP9IS0CBBf2sjYhBO_xQ3RW6YpVrPNR6w=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Array-like objects may surprise you at times if you do not recognize them. I have compiled some of my experiences in dealing with them.\nPlease have a look at this article and let me know what do you think about it.","datePublished":"2020-10-23T12:34:50.499Z","url":"https://daily.dev/posts/wupufvKGf#c-I5YXDWVeu","author":{"@type":"Person","name":"Tapas Adhikary","url":"https://daily.dev/atapas","image":"https://lh3.googleusercontent.com/a-/AOh14GhN71PeWrtSoinbdnOhZS9usr2nbP111YlpswhWaBg=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"const arrayLikePrototype = {\nforEach(callback) {\n[…this].forEach((item, index) =&gt; {\ncallback(item, index);\n});\n},\n};\n\nObject.assign(Object.prototype, arrayLikePrototype);\nfunction checkArgs() {\narguments.forEach(function (item, index) {\nconsole.log(index [${index}] value [${item}]);\n});\n}\ncheckArgs(1, 45, 55);\nIn addition. We could add our methods to object prototypes &amp; we can access those as native array methods as show above.","datePublished":"2024-03-31T13:15:24.212Z","dateModified":"2024-03-31T13:20:05.076Z","url":"https://daily.dev/posts/wupufvKGf#c-obh51aQjf","author":{"@type":"Person","name":"Saravana sai","url":"https://daily.dev/saravana_sai","image":"https://lh3.googleusercontent.com/a/ALm5wu3y4D3D5ELOm81cepSfFmc3dodajIDS4J9XK4sl3g=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

