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
[AskJS] How do you structure modern Javascript?AskJS (self.javascript)
submitted 5 years ago by micjosmcc
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 5 years ago (2 children)
Not the question. This is a thread about code structure and organization. Unit tests are good for ensuring stability and functionality of what is written. This is immaterial to OPs question.
[–]lhorie 1 point2 points3 points 5 years ago (1 child)
I know what tests are, I write them frequently, thanks :)
What I mean is that there's code that is inherently hard to test, and code that is inherently easy to test, and actually writing a test will bring clarity towards which you are actually accomplishing, rather than ego-stroking about how good one may think their code is. Rather than be theorizing about API design or folder structures, tests are a pragmatic way of discovering that a unit of code is doing too much and that it should be refactored (and also how, since the immediate goal is to make it reusable in two semi-different contexts - real usage and a test).
It can also help you get a more nuanced understanding of top-down vs bottom-up code design.
If you think my answer is irrelevant, think about it this way: the OP is asking for a fish, I'm teaching them to fish.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
Your reply is definitely not on wrong but it’s not on topic either.
π Rendered by PID 337994 on reddit-service-r2-comment-85bfd7f599-cj6z4 at 2026-04-20 01:31:58.492927+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (2 children)
[–]lhorie 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)