Are there constants in JavaScript?

后端 未结 30 2905
抹茶落季
抹茶落季 2020-11-22 08:53

Is there a way to use constants in JavaScript?

If not, what\'s the common practice for specifying variables that are used as constants?

30条回答
  •  日久生厌
    2020-11-22 09:28

    I use const instead of var in my Greasemonkey scripts, but it is because they will run only on Firefox...
    Name convention can be indeed the way to go, too (I do both!).

提交回复
热议问题