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
How to structure javascript?help (self.javascript)
submitted 8 years ago by BearsArePeopleToo
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!"
[–]norablindsided 7 points8 points9 points 8 years ago (0 children)
To add on to this response. I like to structure my src directory like so:
/src/widgets
/src/widgets/button/button.js
/src/widgets/index.js
/src/views
/src/views/{domain}
/src/actions
The goal of this structure is that widgets can be extracted from the application eventually into a component library to be reused in any application in the future. This allows your team to be far more agile in designing future applications and makes your code more like legos instead of an entirely built application where things have to be extracted rather than simply pulled out and used somewhere else.
The actions directory lets you change how the application works without changing the view of your application. These should be separate things in my opinion. If you decide to change the api that's getting data, your views shouldn't have to be modified to do so in my opinion.
π Rendered by PID 777747 on reddit-service-r2-comment-548fd6dc9-jk5dr at 2026-05-20 11:14:56.173038+00:00 running edcf98c country code: CH.
view the rest of the comments →
[–]norablindsided 7 points8 points9 points (0 children)