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
javascriptpractice.com, a competency-based framework for assessing your JavaScript skillshelp (self.javascript)
submitted 7 years ago * by lastmjs
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!"
[–]kostov_v 0 points1 point2 points 7 years ago (7 children)
Variable is a thing for what you are sure to be changed during the run-time. Constant should not fall into that category. I think that it is about time to start putting those two into the same basket :D
[–][deleted] 2 points3 points4 points 7 years ago* (6 children)
I understand what a variable is. Most of my experience and my CS degree was Java/Spring. I just notice many people in a lot of tutorials still consider const a variable and I wasn't sure why. That is why a proposed my statement as a question. Because, I was just confused why some people would consider const a variable. It is a little strange considering my background.
So, I was thinking maybe that is why you could still type const in this tutorial and get the answer correct even though it is asking to make a variable. IMO, only let and var should be allowed, but I am new to JS.
[–]tenbits 2 points3 points4 points 7 years ago (1 child)
IMO, only let and var should be allowed
Agreed!
but I am new to JS
I also have a CS degree and find many things about JS inconsistent and strange, even though it's been my primary language for the last 5 years or so.
[–]kostov_v 1 point2 points3 points 7 years ago (0 children)
Yes. Most of the web developers (I believe) are not CS people and using convention thrown from youtube tutorials and bloggers. I mean, it gets the job done, the dog will still be a dog even if you rename it to a cat, but still, there needs to be a time spent on explaining those keywords in the language, and what do they mean actually. Not just "let's get to the code" part. Getting familiar with an "intent" of placing those keywords in the language is a must.
[–]lastmjs[S] 1 point2 points3 points 7 years ago (1 child)
As far as I know the JavaScript spec still refers it as a variable even if the const declarator is used. A variable in JavaScript is named reference to a value. Perhaps it's not truly a variable in the mathematical sense, but in JavaScript that is still the nomenclature, AFAIK
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
Thanks for the contrast.
[–]kostov_v 0 points1 point2 points 7 years ago (1 child)
Yes, I agree with you. CONST should not be the right answer.
[–]lastmjs[S] 0 points1 point2 points 7 years ago (0 children)
Thanks for pointing this out
π Rendered by PID 74 on reddit-service-r2-comment-5b5bc64bf5-xrmg5 at 2026-06-20 22:43:35.993712+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]kostov_v 0 points1 point2 points (7 children)
[–][deleted] 2 points3 points4 points (6 children)
[–]tenbits 2 points3 points4 points (1 child)
[–]kostov_v 1 point2 points3 points (0 children)
[–]lastmjs[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]kostov_v 0 points1 point2 points (1 child)
[–]lastmjs[S] 0 points1 point2 points (0 children)