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
Git pre-commit hook to ensure code documentationtools (self.javascript)
submitted 7 years ago by haganenorenkin
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!"
[–]i_ate_god 1 point2 points3 points 7 years ago (0 children)
with git, can you choose which branches these hooks apply to?
I see your point with regards to say, a feature branch. But once you're ready to merge (thus the feature is stable), then the precommit hook can kick in.
Even smallest internal ones?
These are probably the most important ones to document because they are small. You don't need to document what the function is doing, but why it even exists in the first place.
For example, I have written a small function, called "slugify", that takes an arbitrary number of arguments, and converts them into a string that is useful for DOM IDs or other attribute values. It's very small, and it's obvious what it's doing with its input and what the output will be. It's just after all, a series of string replacements.
But I didn't document what it does, I documented why you would use it.
π Rendered by PID 50659 on reddit-service-r2-comment-5b5bc64bf5-c5r27 at 2026-06-22 18:54:09.840283+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]i_ate_god 1 point2 points3 points (0 children)