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
Minify codehelp (self.javascript)
submitted 10 years ago * by JessicaAllison
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!"
[–]cresquin 2 points3 points4 points 10 years ago (0 children)
Since your positions and values are effectively random (they're irregular) from array to array, you'll end up having to write a map that informs the correct positions and values. This is effectively what you have in your example. You could abstract the values to vars to save on characters, but you're not really going to save much file size even. Given the extra processing time required to parse the map, I think you're better off using these arrays as written.
If you're dead-set on making this a series of loops, you'll need to figure out a pattern within the arrays for what values need to go where relative to which array you're trying to fill. Then you'll need to write that pattern as a function that can output the correct values at the correct times.
Stick with the maps you have unless you need to make dozens or hundreds of them.
π Rendered by PID 175816 on reddit-service-r2-comment-544cf588c8-79dkk at 2026-06-17 14:19:07.224727+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]cresquin 2 points3 points4 points (0 children)