First of all, constants are super-global and do not need to be defined in multiple places, which reduces development costs
Secondly, the main function of constants can avoid repeated definitions and tampering with their values. When team development or when the amount of code is large, when defining some data that you do not want to change. If you use global variables, if you accidentally use the same variable name in subsequent code, the previous variable value will be replaced, and the code running result will not be what we expect
First of all, constants are super-global and do not need to be defined in multiple places, which reduces development costs
Secondly, the main function of constants can avoid repeated definitions and tampering with their values. When team development or when the amount of code is large, when defining some data that you do not want to change. If you use global variables, if you accidentally use the same variable name in subsequent code, the previous variable value will be replaced, and the code running result will not be what we expect