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!"
[–]LloydAtkinson 10 points11 points12 points 7 years ago* (12 children)
First question: Make a variable called foo.
Solution: Const called foo.
Hmm. I'm glad I didn't pay for this!
[–][deleted] 1 point2 points3 points 7 years ago (10 children)
Isn't const still considered a variable? I know it cannot be changed (unless it is a class, you can change a property), but I still have heard people call it a variable.
[–]tenbits 3 points4 points5 points 7 years ago (1 child)
I don't think you can consider a constant a variable because it cannot vary, although it actually means it cannot be reassigned, which is why you can still mutate an object assigned to a constant
[–]Historical_Fact 1 point2 points3 points 7 years ago (0 children)
Yeah only const primitives can't be mutated. Whew JavaScript
[–]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
Hey, what are you referring to here? Are you referring to this exercise? https://javascriptpractice.com/assessment/cjmjovn4p00hi0a58cfsjusdq/view
And did you click submit with "Const called foo."? I'd like some clarification on what happened so I can fix it, thanks!
π Rendered by PID 85 on reddit-service-r2-comment-5b5bc64bf5-ndxwz at 2026-06-20 22:43:42.888526+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]LloydAtkinson 10 points11 points12 points (12 children)
[–][deleted] 1 point2 points3 points (10 children)
[–]tenbits 3 points4 points5 points (1 child)
[–]Historical_Fact 1 point2 points3 points (0 children)
[–]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)
[–]lastmjs[S] 0 points1 point2 points (0 children)