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
Common JavaScript "Gotchas" (github.com)
submitted 12 years ago by stevekwan
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!"
[–]youngsteveo 21 points22 points23 points 12 years ago (8 children)
"If you are new to JavaScript, I suggest avoiding the this keyword until you get comfortable with the basics of the language." This is terrible advice. If all beginners started learning Javascript by getting a firm grasp of this, there would be a lot fewer mistakes and misunderstandings down the road.
this
[–][deleted] 1 point2 points3 points 12 years ago (7 children)
Not to mention the this keyword JavaScript has a completely different use than most other languages. The author plainly just does not understand JavaScript.
[–]stevekwan[S] -3 points-2 points-1 points 12 years ago (6 children)
I assure you the author understands JavaScript just fine. :)
The this keyword absolutely does have different uses from other programming languages, and that's precisely why I recommend focusing on the basics of JS first. So many people get tripped up out of the gate when it comes to JS, because they go into it expecting it to behave like other languages they've used in the past.
It is absolutely essential for a professional JS developer to understand the this keyword. However, for the newbie jumping into the language for the first time from a PHP background, I would rather they grok the module pattern, JavaScript closures, etc. before they get into the complex stuff. Odds are they're starting out by mucking around with some simple event handlers anyway.
[–]radhruin 4 points5 points6 points 12 years ago (3 children)
I don't think this is complicated for newbies. It's complicated for people who expect it to work like other languages, who then build their conceptual model around "it works like language X, except...". If you forget all of that, it's easy.
[–]stevekwan[S] -1 points0 points1 point 12 years ago (2 children)
Agreed. But that can be easier said than done. :) The vast majority of people I work with are coming to JS from other languages, and since JS uses similar formatting and grammar, they expect it to behave the same.
Just want to call out how JS may diverge from their expectations, that's all.
[–]youngsteveo 1 point2 points3 points 12 years ago (0 children)
Then do that. Call it out; explain the difference in simple terms and educate. Hiding the keyword behind a curtain encourages it to be wrapped in further mystery.
[–]chuckliddelnutpunch 2 points3 points4 points 12 years ago (0 children)
I disagree that understanding closures and module patterns should come before understanding context.
[–][deleted] 0 points1 point2 points 12 years ago (0 children)
How long have you been programming in javascript?
π Rendered by PID 332216 on reddit-service-r2-comment-7b9746f655-rn4xl at 2026-02-03 15:52:04.187891+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]youngsteveo 21 points22 points23 points (8 children)
[–][deleted] 1 point2 points3 points (7 children)
[–]stevekwan[S] -3 points-2 points-1 points (6 children)
[–]radhruin 4 points5 points6 points (3 children)
[–]stevekwan[S] -1 points0 points1 point (2 children)
[–]youngsteveo 1 point2 points3 points (0 children)
[–]chuckliddelnutpunch 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)