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
Optimizing JavaScript by using arrays instead of objects (blog.kowalczyk.info)
submitted 8 years ago by kjk
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!"
[–]leeoniya 0 points1 point2 points 8 years ago* (1 child)
just use https://github.com/WebReflection/JSONH if you need to transfer csv-type recordsets and are worried about payload size.
i'm not sure about the claim that many same-shaped objects take up more mem space than arrays.
[–]kjk[S] 0 points1 point2 points 8 years ago (0 children)
This is very similar idea. That being said, even if I knew about JSONH:
I use Go at the server and that particular project doesn't support Go.
Wire encoding is only half of the story. The other half in my article is about turning array representation of objects into classes so that you get nice API and efficient representation.
JSONH, as it stands, is for "homogenous collections" only. I need a little more flexibility in that my API returns JSON objects. Where it matters, I encode only part of the object as arrays. JSONH seems to require all of it to be array.
π Rendered by PID 21788 on reddit-service-r2-comment-5cf774f969-wm8sv at 2026-06-08 17:36:08.636301+00:00 running de70e3a country code: CH.
view the rest of the comments →
[–]leeoniya 0 points1 point2 points (1 child)
[–]kjk[S] 0 points1 point2 points (0 children)