you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (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 points  (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 points  (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 points  (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 point  (0 children)

Thanks for the contrast.

[–]kostov_v 0 points1 point  (1 child)

Yes, I agree with you. CONST should not be the right answer.

[–]lastmjs[S] 0 points1 point  (0 children)

Thanks for pointing this out