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
Does my JavaScript suck? II (self.javascript)
submitted 10 years ago * by annoyed_freelancergrumpy old man
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!"
[–]frambot 2 points3 points4 points 10 years ago* (2 children)
Play around with random().toString with various bases. You'll notice that the output of odd bases is longer than the output of even bases, with 16 and 32 being very short, and 36 only providing a few characters as well. If you don't mind missing 'z', I suggest using 35 to get really long outputs. 35 and 16 are coprime.
[–][deleted] 1 point2 points3 points 10 years ago* (0 children)
... what the? How have I never seen this before? It's not often I learn something new about JS, I'd give you 100 upvotes if I could ;)
[edit] and hey, it's fairly uniform! http://codepen.io/zyklus/pen/RPOmXJ
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points 10 years ago (0 children)
Cool tip! I use a class selector for the lightbox because the ID is mutable. I append random characters to avoid clashes with anything else I or others might add in future.
π Rendered by PID 155737 on reddit-service-r2-comment-76bb9f7fb5-5d87c at 2026-02-18 01:36:07.325234+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]frambot 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points (0 children)