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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:54:03+00:00 2026-06-11T14:54:03+00:00

Coming from Java I really like the flexibility afforded by the rich collection of

  • 0

Coming from Java I really like the flexibility afforded by the rich collection of data structures provided by Guava. Is there a “guava-like” library in js or jquery?

Note: I heard about closure and it seems a bit heavy – anything simpler? (or is closure really what I need?)

Note 2: by “rich collection of data structures” I mean sorted maps and sets, multimaps (duplicate keys allowed) and multisets (sets with multiple entries allowed – seems strange but actually very useful!), etc.

  • 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-11T14:54:04+00:00Added an answer on June 11, 2026 at 2:54 pm

    If by “the rich collection of data structures” for JS you meant utility for operating on JavaScript Arrays and Objects and JavaScript itself, then I’d recommend Underscore.js:

    Underscore is a utility-belt library for JavaScript that provides a
    lot of the functional programming support. (…) Underscore provides
    60-odd functions that support both the usual functional suspects: map,
    select, invoke — as well as more specialized helpers: function
    binding, javascript templating, deep equality testing, and so on. It
    delegates to built-in functions, if present, so modern browsers will
    use the native implementations of forEach, map, reduce, filter, every,
    some and indexOf.

    It also has Set-like functions like union, intersection and difference, type-checking functions isXXX (isArray etc.), function goodies and more stuff you’d write yourself without such a library.

    Underscore has clean code, is well tested and quite popular these days, I use it on daily basis in JS projects.


    EDIT after question edit:

    I know Guava has multimaps, multiset etc. but they are all consequesnce of Java design and it’s hard to write 1 to 1 implementation of these collections in JS. It’s because Javascript has no:

    • static typing,
    • classes in Java sense, uses prototyping instead (see this answer),
    • interfaces (but has functions as first-class objects on the other hand),
    • easily defined object equality (var t1 = { test: 1 }, t2 = { test: 1 }; t1 === t2 is false)

    so it’s hard to write general-use Set implementation, not mentioning Multiset or Multimap. There are for example some Set implementations like Closure’s one or this one, but they are not perfect – first modifies elements inserted into Set (!), the second is not a mainstream, well-tested project (and personally I’ve never used it so can’t say more).

    In Javascript you just do var multimap = { key: [ 1, 2, 3.0 ], key2: [ 4, 'test', { bla: null }, 1 ] } and because of language design you can’t just do multimap.containsValue({ bla: null }). I mentioned underscore.js because it has 95% utility functions you’ll ever with JS collections, that is Arrays and Objects. If you want more, just use Closure’s structs, but the library itself it’s quite big.

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

Sidebar

Related Questions

Coming from Java background I am guessing this is expected. I would really love
Coming from NHibernate, I've tried to do something like this in Java (first example):
Coming from Java development where build and project management tools abound, I'd like to
Coming from Java, I am new to C# and LINQ. There are many queries
I'm trying to learn C now, I'm coming from Java and there is some
Coming from Java , I'm used to the package structure (com.domain.appname.tier) Now I've started
I am coming from Java to Ruby and this -7 mod 3 = 2
Background: I'm coming from Java background so not too familiar with Javascript. We are
new to Laravel (coming from Java spring), while using Route::get('/', function() { return Hello
I'm coming from Java/C++ to Ada and am having trouble figuring out the small

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.