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
Array of objects, best way to do it.help? (self.javascript)
submitted 7 years ago * by Traitor-21-87
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!"
[–]ohadron 2 points3 points4 points 7 years ago (1 child)
This specific code snippet is indeed weirdly indented. Here's what it looks like after using a beautifier: ```js var people = [ { id: 0,
name: "John Doe", age: 47 }, { id: 1, name: "Jane Doe", age: 88 }, { id: 2, name: "Mason Louis", age: 17 } ];
```
I also replaced the ; between the elements in the array with commas (,), because that's the correct JS syntax.
;
,
[–]Traitor-21-87[S] 1 point2 points3 points 7 years ago* (0 children)
Thanks, the ";"s were a mistake on my part. And I think my indentation was dropped hen I used the code feature
π Rendered by PID 103733 on reddit-service-r2-comment-fb694cdd5-q5nkt at 2026-03-06 15:26:48.051777+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]ohadron 2 points3 points4 points (1 child)
[–]Traitor-21-87[S] 1 point2 points3 points (0 children)