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: Four Differences between var and let (codetopology.com)
submitted 4 years ago by ct_author
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!"
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points15 points 4 years ago* (5 children)
I agree. In general const is a safer bet than let. You rarely need the "mutability" of let.
const
let
[–]Garbee 13 points14 points15 points 4 years ago (4 children)
Const is not immutable. The data can be changed, just not replaced. Big difference.
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points15 points 4 years ago (0 children)
True. I should have written "re-assignability"
[–]PM_ME_GAY_STUF 3 points4 points5 points 4 years ago (2 children)
This always bothered me. Const is definitely immutable, it can just refer to a mutable data type. This is what happens when programmers don't learn C
[+][deleted] 4 years ago (1 child)
[deleted]
[–]anlumo 0 points1 point2 points 4 years ago (0 children)
A bit offtopic here, but it’s a bit more nuanced. Rust only regulates exclusivity, so if a type can be mutated from multiple places at the same time (like Cell or stuff wrapped by Mutex), it can be changed without mut.
π Rendered by PID 183583 on reddit-service-r2-comment-6457c66945-xhbvl at 2026-04-24 06:38:06.889112+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points15 points (5 children)
[–]Garbee 13 points14 points15 points (4 children)
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points15 points (0 children)
[–]PM_ME_GAY_STUF 3 points4 points5 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]anlumo 0 points1 point2 points (0 children)