Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:04:49+00:00 2026-06-17T11:04:49+00:00

I have a large JavaScript object that contains properties that are added and deleted

  • 0

I have a large JavaScript object that contains properties that are added and deleted as and when required. Something similar to this:

var data = {

  data1: {
      subscribers : ["sub1", "sub2"]
  },

  data2: {
      subscribers : ["sub1", "sub2"]
  }

  //[0...*]

};

I want the subscribers from “data2” so I use data["data2"].subscribers to access this information.

But my questions are:

  • What are JavaScript internal workings of accessing properties like this (dot notation, using the property name)?
  • Does the size of the object have an effect on how fast the subscribers array is returned?

My guess would be that the size would effect the speed of receiving the returned data because I think the way that JavaScript accesses the properties is using a for loop over the objects:

function getSubs(name) {
    for(var prop in data) {
        if(prop === name) {
            return data[prop].subscribers;
        }
    }
}
var subs = getSubs("data2");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:04:51+00:00Added an answer on June 17, 2026 at 11:04 am

    No, it doesn’t work by iterating over all the properties but basically by using the frequently used hash table pattern before compilation and classes after compilation (read more here regarding V8).

    In fact, that’s part of the internal working of javascript engines, not the specification. What you need to know is :

    Yes, having many properties may have an impact but much lighter than what you seem to think. Don’t worry about it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a JSON document / JavaScript object that looks like this:
I have a JavaScript object with a huge amount of data in it, including
I have some data which I originally stored in a generic Javascript object, with
I have some javascript that generates a large list of <select> options ( <option>
I would like to have some sort of lazy initialied object properties in javascript
I have a rather large and convoluted JavaScript module that is used on multiple
Folks, I have been tasked with recforing a large system that comprises many javascript
I have a large object in C# that i would like to write (serialize)
I have a large javascript which I didn't write but I need to use
I have an SVG I am building with Javascript. I load in a large

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.