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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:53:16+00:00 2026-06-06T08:53:16+00:00

I am in need of a Javascript data structure which will allow me to

  • 0

I am in need of a Javascript data structure which will allow me to insert strings and search for strings efficiently. I have been looking around and the only data structures I have come across are objects and arrays. Objects are more used for encapsulation and cannot really be used for searching and using arrays can be slow. Are there any other data structures that will allow me to insert and search strings efficiently? Right now at best I could do a binary search on an array. Any other ideas? Thanks.

  • 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-06T08:53:19+00:00Added an answer on June 6, 2026 at 8:53 am

    Objects are more used for encapsulation and cannot really be used for
    searching

    That was true in classical languages, not so true in JS.

       var obj = { memberone: "value1" }
    
       var value = obj["memberone"];
    
       //value === "value1"
    

    Objects can be searched in JS. Bear with me…

    and using arrays can be slow.

    Yes, can be – but don’t have to be.

    Are there any other data structures that will allow me to insert and
    search strings efficiently?

    Data structures? No. Again that is a classical perspective. In JS, it is different.

    Check out _underscore.js.

    1. It is 4k min gzip.
    2. It provides a number of advanced iterator helpers (so you don’t have to)
    3. It provides templates to display your data to screen efficently.
    4. It will benefit the rest of your development, maintenance, and implementations.

    This is a good example of JS flexibility.

    Hope that helps.
    All the best!
    Nash

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

Sidebar

Related Questions

I have the following javascript which I need to make dynamic. data.addRows(2); data.setValue(0, 0,
I need help understanding the best way to manipulate a JavaScript data structure (if
I have a service which returns a Json data structure. One of the properties
I´ve a Javascript object with all the data that I need to store on
Possible Duplicate: In need of JavaScript Solution for Exporting table to Excel which works
I need to implement a spatial data structure to store rectangles then be able
This is a JavaScript/Ajax webpage (also using jQuery). I have a nested structure I
I need a mechanism for storing complex data structures created in client side javascript.
I'm trying to find a way to "pretty print" a JavaScript data structure in
I'm trying to populate a table structure with around 5 fields of data from

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.