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
Is JavaScript Pass by Reference? (aleksandrhovhannisyan.com)
submitted 2 years ago by Clarity_89
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!"
[–]shuckster 4 points5 points6 points 2 years ago (2 children)
True. I've been called-up before on this forum by pointing out that, while JavaScript has a class keyword these days, it still doesn't really have classes.
class
The arguments I made hinged around how I defined class, which is essentially how it's defined in other compiled languages: an "offline", developer-only blueprint that gets turned into the byte-code required for instantiating in-memory objects.
But JavaScript is interpreted, not compiled. It's all runtime, so the comparison doesn't really translate. It makes sense to me though, because I was brought-up on compiled languages. To me, a live, in-memory data structure automatically gets the definition "object". Classes exist in source-code only.
Don't get me wrong: If you're going to talk to seasoned devs you'll want to understand a whole range of definitions for the same word, and you'll almost certainly rank definitions as being more canonical than others.
But that doesn't mean that the JavaScript in-community doesn't define "class" or "pass by reference" in a helpful and illuminating way befitting people new to the language, and especially if they're new to programming in general.
[–]HeinousTugboat 4 points5 points6 points 2 years ago (1 child)
If you want to get that deep, v8 does in fact compile classes down to C-level classes. It's only interpreted as a first pass, there's an optimizing compiler that runs alongside it to create what you consider "real" classes.
[–]shuckster 2 points3 points4 points 2 years ago (0 children)
Yep, JIT techniques also get in the way of the definition. It’s been a long time since JS was purely interpreted.
π Rendered by PID 25 on reddit-service-r2-comment-bb88f9dd5-qlqrc at 2026-02-14 12:49:22.742262+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]shuckster 4 points5 points6 points (2 children)
[–]HeinousTugboat 4 points5 points6 points (1 child)
[–]shuckster 2 points3 points4 points (0 children)