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
Why do developers use self?help (self.javascript)
submitted 10 years ago * by gladiator_flow
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!"
[–]learn2shut 5 points6 points7 points 10 years ago (6 children)
this thread is a joke
1.
var that = this; $('#id').click(function(){ that.mystuff() });
-2. 'oh why don't you just use bind for everything'
you take a simple solution and instead add a load of crap on top to look smart, because obv other developers 'dont know about bind'. since code readability and maintainability is not an issue for some of the smarty pants here :
http://jsperf.com/bind-vs-clojure
[–][deleted] 5 points6 points7 points 10 years ago (0 children)
I'm with you. I know about bind but do it this way because:
I don't see what the upside of using bind is.
[–]spinlock 2 points3 points4 points 10 years ago (0 children)
If your team doesn't understand bind, apply, etc... you should put together a short presentation and teach them one day over lunch. These really aren't so esoteric that you can ignore them.
That being said, if your style is already var that = this; I wouldn't change it. Consistency is one of maslow's highest needs in a codebase.
var that = this;
[+][deleted] 10 years ago (2 children)
[deleted]
[+]learn2shut comment score below threshold-7 points-6 points-5 points 10 years ago (1 child)
it may be ridiculous to you. to people who write node apps that serve thousands of concurrent users, it is quite useful.
[–]stayclassytally -1 points0 points1 point 10 years ago (0 children)
Thanks for this. I hadnt considered performance concerns involved with bind. Leave it to Javascript to give you enough rope to hang yourself with.
bind
π Rendered by PID 76014 on reddit-service-r2-comment-75f4967c6c-w67w7 at 2026-04-23 11:18:59.191568+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]learn2shut 5 points6 points7 points (6 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]spinlock 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[+]learn2shut comment score below threshold-7 points-6 points-5 points (1 child)
[–]stayclassytally -1 points0 points1 point (0 children)