Constant 1/3
What are Constants?
Constants are created just like the var and let. We use the const keyword for initializing constants, for example.
12const NUMBER = 58; console.log(NUMBER);
Variables declared with const are very much similar to the variables declared with the let keyword, but the only difference is that we cannot reassign values to the variables declared with the const keyword.
123const PI = 3.141592653589793; PI = 3.14; // error console.log(PI);
Swipe to start coding
Declare a variable by using the const keyword with the identifier FIXED and assign the value 10 to it also display the value on the console.
Oplossing
Bedankt voor je feedback!
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Can you explain the difference between const, let, and var?
What happens if I try to change the value of a const variable?
Are there any exceptions where const variables can be modified?
Geweldig!
Completion tarief verbeterd naar 2
Constant 1/3
Veeg om het menu te tonen
What are Constants?
Constants are created just like the var and let. We use the const keyword for initializing constants, for example.
12const NUMBER = 58; console.log(NUMBER);
Variables declared with const are very much similar to the variables declared with the let keyword, but the only difference is that we cannot reassign values to the variables declared with the const keyword.
123const PI = 3.141592653589793; PI = 3.14; // error console.log(PI);
Swipe to start coding
Declare a variable by using the const keyword with the identifier FIXED and assign the value 10 to it also display the value on the console.
Oplossing
Bedankt voor je feedback!
single