Answers for "4.4.1. Creating Constants With const¶"

0

4.4.1. Creating Constants With const¶

/*One of the key features of variables that we have discussed so far 
is their ability to change value. We can create a variable with one 
value, and then reassign it to another value.*/

let programmingLanguage = "JavaScript";
programmingLanguage = "Python";

/*We might store the name of our application in a variable so that it 
can be referenced anywhere we want to display the application name.*/

let appName = "Get It Done!";

/*Using const rather than let to create a variable ensures that the 
value of the declared variable cannot be changed.*/

const appName = "Get It Done!";

/*Such an unchangeable variable is known as a constant, since its value 
is just that.*/
Posted by: Guest on June-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language