Let and Const

Let is a variable type that cannot be redeclared multiple times, any other declaration will result a syntax.

When should you use Let?

You should use let when you know that the value you are setting should not change, If the Variable you want is strictly going to be for one specific value, then Let or Const is the variable type you should use since you do not want to redeclare them.

Diference between Let and Const

Constant can be declared only one time and not be changed, for example server ID.

Let will last for each event, for example Interaction author.

For example I have set my name to John, since I want John to be the fixed value that cannot be changed.

Last updated