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

  • Home
  • SEARCH
  • 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 6390005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:28:26+00:00 2026-05-25T03:28:26+00:00

I am not sure how the Javascript engines (specifically browser engines) store an array.

  • 0

I am not sure how the Javascript engines (specifically browser engines) store an array.

For example – how much memory would this use?

var x = new Array(0, 1, 2, 1000, 100000000);

I want to map integer dates as array indexes, but I need to be sure it isn’t a bad idea.

  • 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-05-25T03:28:26+00:00Added an answer on May 25, 2026 at 3:28 am

    Arrays are “special” in only a couple ways:

    • They’ve got some interesting array-like methods from their prototype (“slice()” etc)
    • They’ve got a “magic” length property that tracks the largest numeric property “name”

    If you store something at position 10299123 in a brand-new array, the runtime does not use up all your memory allocating an actual, empty array. Instead, it stores whatever you want to store and makes sure that length is updated to 10299124.

    Now the problem specifically with dates, if you’re talking about storing the timestamp, is that (I think) they’re bigger than 32-bit integers. Array indexes are limited to that size. However, all that means is that length won’t be correct. If you don’t really care about any of the array stuff anyway, then really all you need is a plain object:

    var dateStorage = {};
    
    dateStorage[someDate.getTime()] = "whatever";
    

    JavaScript objects can be used as name-value maps as long as the name can be represented as a string (which is clearly true for numbers).

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

Sidebar

Related Questions

I'm not sure how I would do this in Javascript. I want to create
JavaScript is not my strong point, but then I'm not sure I'm hitting this
Not sure if this is a javascript issue or can be solved with CSS.
So I know javascript pretty well, but I'm not sure about this one. Tough
not sure why my code wont work, im teaching myself javascript i know php
In Javascript, I want my onmouseout event to sleep/pause/wait/ (not sure of the proper
I want to handle F1-F12 keys using JavaScript and jQuery. I am not sure
Not sure if this is possible or if I'm expressing correctly what I'm looking
Not sure how to ask a followup on SO, but this is in reference
I'm not sure how to achieve the following in javascript, or even if I'm

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.