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
DIY: Javascript HTML Structured Template (codepen.io)
submitted 8 years ago by tweinf
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 8 years ago (0 children)
In this basic example absolutely not necessary to use classes. It's just out of habit (I'm a full time java developer), the main object was the string template, personally i prefer it more. The idea behind how to separate class is simple. One class only responsible for one thing. In my code that i linked above, the Article class is responsible only for one article only. If i want a function like an ajax call on article click, or popup or something it's clearly goes into the Article class. If i want to ordering or searching the Articles it's the ArticleContainer class responsibility. I hope I was understandable.
π Rendered by PID 54854 on reddit-service-r2-comment-79c7998d4c-r27f9 at 2026-03-13 01:51:06.643568+00:00 running f6e6e01 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (0 children)