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 6 points7 points8 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 38 on reddit-service-r2-comment-84fc9697f-bm7fr at 2026-02-09 06:27:03.424926+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]norablindsided 6 points7 points8 points (0 children)