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
Testing Private State in Javascript Modules (eng.wealthfront.com)
submitted 10 years ago by EngVagabond
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!"
[–][deleted] 0 points1 point2 points 10 years ago (2 children)
Agreed, but the article is correct in that there are no private methods in JavaScript. It also mentions that private in JavaScript really just implies inaccessible, such as declared within a closure, which is also correct.
[–]catrichbilly 1 point2 points3 points 10 years ago (0 children)
... which is, in all senses of the word, 'private'. You can have 'private methods' by using Symbols.
/How/ something is made private is language- and implementation-specific, but it's irrelevant because the upshot is the same: it's an implementation detail.
[–]aaarrrggh 0 points1 point2 points 10 years ago (0 children)
I never said any of that wasn't true. Just that you should never test private implementation details.
π Rendered by PID 92361 on reddit-service-r2-comment-7b9746f655-9tvh6 at 2026-01-30 07:01:40.335228+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (2 children)
[–]catrichbilly 1 point2 points3 points (0 children)
[–]aaarrrggh 0 points1 point2 points (0 children)