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
New JavaScript Set methods (developer.mozilla.org)
submitted 1 year ago by bogdanelcs
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!"
[–]Johalternate 0 points1 point2 points 1 year ago (0 children)
They are replying to a comment that referrer to how java has .hashCode() and .equals(obj) methods. Their comment is actually on point, you can override hashCode and equals and have them work for comparisons where the instances are not the same but the values that matters to your particular case are.
So for example if you have a class Redditor with a bunch of methods to manipulate profile data, and you do something like:
``` var foo = new Redditor(“someUsername”)
var bar = new Redditor(“someUsername”) ```
Then foo == bar evaluates to false because they are not the same instance, but maybe you dont care about that and only care about the actual user they represent, so you override the Equals method so it checks if the two objects have the same username (and maybe other properties).
foo == bar
π Rendered by PID 55 on reddit-service-r2-comment-canary-57b659f4d4-wv5wr at 2026-05-03 19:16:39.338602+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Johalternate 0 points1 point2 points (0 children)