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 7971283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:36:09+00:00 2026-06-04T07:36:09+00:00

Double your localStorage read performance in Chrome using indexes ls.getItem[i] not keys ls.getItem(‘key’) Source:

  • 0

Double your localStorage read performance in Chrome using indexes ls.getItem[i] not keys ls.getItem('key')

Source: this tweet and this talk (slide 19) by some guys that wrote a couple of awesome JavaSciript libraries. I guess these guys know what they are talking about, so I’m wondering why this doesn’t work for me:

localStorage.setItem(0, 'Hello world');
localStorage.getItem(0); // 'Hello World' – Works as expected
localStorage.getItem[0]; // undefined

Did I misunderstand something? According to that talk, the last method call should return 'Hello world' not undefined.

They’ve also linked to this JS Bin, but when reading the values via index there, I still get undefined.

Edit: I know how to properly read the indexes with localStorage, I’m asking about getItem with indexes. It seems the talk just suggests a wrong usage? Also, I wonder why 32 people retweeted that usage, without having tested it. Those things irritate me.

  • 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-04T07:36:11+00:00Added an answer on June 4, 2026 at 7:36 am

    My name is Chris and I am the one responsible for the slide that is causing confusion. For the confusion, I apologize. The slide was somewhat of a joke; allow me to explain..

    In the days leading up to our panel, a tweet was posted and retweeted about doubling your read performance of localStorage. The tweet is the one you referenced (Twitter). However, when I saw this tweet, I did a double take because the syntax looked very wrong to me. I tested the syntax only to discover the same thing that you did: this syntax is clearly not valid if you are trying to access values in localStorage.

    On stage at SXSW, this myth was presented as a joke. Yes, you get double the performance from referencing number indexes on localStorage.getItem. However, all of the values are undefined.

    Anyway, it appears that in the attempt to undo the spread of misinformation, I have managed to spread it further. Thanks for bringing the issue to our attention!

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

Sidebar

Related Questions

I'm having trouble with double entries in my django database and hope for your
So my assignment is this: Using your knowledge of square roots in addition to
JavaScript doesn't care if your Strings are double-quoted double or single-quoted 'single' . Every
If you return a double or float from your MBean jconsole seems to round
Possible Duplicate: Why not use Double or Float to represent currency? I'm writing a
SQL query: CREATE TABLE `animals`.`ads_DB` ( `id` DOUBLE( 25 ) NOT NULL AUTO_INCREMENT PRIMARY
Alternative wording : When will adding Double.MIN_VALUE to a double in Java not result
I'd like your help with understanding why this function does not stop when I
double? test = true ? null : 1.0; In my book, this is the
double d[10]; int length = 10; memset(d, length * sizeof(double), 0); //or for (int

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.