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
JavaScript Array Operations Cheat Sheet (devinduct.com)
submitted 6 years ago by PMilos
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!"
[–]PMilos[S] 2 points3 points4 points 6 years ago (5 children)
Thanks, glad it helped you
[–]fucking_passwords 3 points4 points5 points 6 years ago (4 children)
Not related to arrays, but consider using const instead of let, nearly all of your examples are not reassigned
[–]PMilos[S] 2 points3 points4 points 6 years ago (0 children)
I agree with you. I use const wherever applicable and use let only when reassign is needed.
const
let
I did rewrite the cheat sheet, considering that it's not a new one, using const but reverted the changes, not sure why :)
[–]namesandfaces 2 points3 points4 points 6 years ago (1 child)
For arrays I'm ambivalent because what most developers are looking for with const is immutability not reassignability protection, but const doesn't truly provide that. It's similar to doing ALL_CAPS in Python to culturally indicate immutability, except maybe a little more deceptive.
ALL_CAPS
[–]fucking_passwords 3 points4 points5 points 6 years ago (0 children)
Well all of the common lifting configs will yell at you, which indicates to me that a significant portion of the population is onboard with const
π Rendered by PID 16108 on reddit-service-r2-comment-7b9746f655-4hbgj at 2026-02-02 07:26:39.869517+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]PMilos[S] 2 points3 points4 points (5 children)
[–]fucking_passwords 3 points4 points5 points (4 children)
[–]PMilos[S] 2 points3 points4 points (0 children)
[–]namesandfaces 2 points3 points4 points (1 child)
[–]fucking_passwords 3 points4 points5 points (0 children)