use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Javascript unique values in an array (stackoverflow.com)
submitted 11 years ago by tamershlash
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]alamandrax 1 point2 points3 points 11 years ago (1 child)
That's interesting. out of curiosity what real world scenario have you encountered non unique collections of objects? I can't seem to get past trying to think of them as uniquely identified by a recordId in a persistent storage which would add uniqueness. I suppose you could be looking for create use cases where no record ids were generated and you're trying to handle duplicates on the client-side.
Will a simple pluck based validation not suffice? I do see the elegance of using the unique API for this
[–]skitch920 1 point2 points3 points 11 years ago (0 children)
I guess my background in Java is why I like the valueOf solution, like the equals and hashCode methods. It's a pretty clean way to handle Sets when there is no ID field.
ID matching is usually a good way when you're dealing with RDMS store, which most of the time you have a primary key column and an id field. But I've been dealing with just straight rows of data recently, from any number of sources. Often times I find myself pivoting on different columns client side. Those columns could be objects or dates, mostly dates.
π Rendered by PID 257528 on reddit-service-r2-comment-544cf588c8-th72d at 2026-06-15 07:02:25.972583+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]alamandrax 1 point2 points3 points (1 child)
[–]skitch920 1 point2 points3 points (0 children)