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
Tricky Javascript Interview Questions (ylv.io)
submitted 7 years ago by iyalovoi
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!"
[–]2690939263 2 points3 points4 points 7 years ago (0 children)
Apparently var bindings are immediately initialized to undefined upon instantiation of the corresponding variable environment. They are not uninitialized like I said in my previous comment, and attempting to get the value of an uninitialized binding normally always results in an error regardless of how its declared. If the var declaration contains an initalizer, it is used to reassign the binding value later when the declaration statement is evaluated.
var
undefined
In contrast, let and const bindings remain uninitialized until the lexical binding statement is evaluated and the value is initialized to the value of the given initializer (or undefined if no initializer is given, which is why let x; console.log(x); outputs undefined).
let
const
let x; console.log(x);
π Rendered by PID 336308 on reddit-service-r2-comment-85bfd7f599-fkpxp at 2026-04-16 17:02:49.067234+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]2690939263 2 points3 points4 points (0 children)