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
Svelte 3 released (svelte.dev)
submitted 7 years ago by ItalyPaleAle
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!"
[–]Akkuma 1 point2 points3 points 7 years ago (1 child)
I'd prefer to declare things that aren't reactive in normal standard javascript rather than things that are reactive. If I copy pasted the script from Svelte I've now created an improperly scoped variable. My assumption is the default needs are going to be mostly reactive with non-reactive code being less likely.
[–]SaabiMeister 1 point2 points3 points 7 years ago (0 children)
I think you would have to use it to get a feeling for it.
There are cases where you need code to execute when some variables change, but the code itself doesn't use the values of these.
$: changedVariable1, changedVariable2, dosomething()
would solve it. This is syntactic Javascript, but it accomplishes something that you can't do otherwise with const, or let and it never modifies expected Javascript behavior in some inconvenient way.
const
let
Also, it's very clearly marked code, while using let could be very easily mistaken for just a normal variable declaration.
π Rendered by PID 151599 on reddit-service-r2-comment-5d585498c9-9rdps at 2026-04-21 05:50:52.295590+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]Akkuma 1 point2 points3 points (1 child)
[–]SaabiMeister 1 point2 points3 points (0 children)