Course Content
Introduction to JavaScript
Introduction to JavaScript
1. Getting Started
Hello WorldTask - Show some OutputTask - Output Multiple LinesNumbersTask - Working with NumbersTask - Calculate the Speed of a CarTask - Calculate Area of a TrapeziumOutputting Multiple ValuesTask - Meaningful OutputCommentsTask - Adding a commentMulti-Line CommentsTask - Commenting out CodeTask - Coffee Shop SalesWhat is JavaScript anyway?
2. Manipulating Data
Storing DataTask - Declaring a VariableTask - Accessing Data From a VariableTask - Fixing Variable NamesTask - Reassigning a VariableConstantsTask - Declaring & Using ConstantsPerforming Arithmetic On VariablesTask - Making a Salary CalculatorTask - Adjusting Salary with a BonusTypes of DataTask - Declare a Boolean ValueHow different Data Types InteractTask - Concatenating StringsTask - User Profile & Activity Details
3. Conditional Statements
Constants
Constants are similar to variables however their value, as expressed by the name, is always constant or unchanged.
We can declare a constant using the const keyword, and it's important to initialize it at the same point as well. Following is the syntax for constant declaration & initialization:
js
For example:
js
Changing the value of a constant results in an error:
js
The names of the constants follow the same naming rules as the variables.
1. What is a constant in JavaScript?
2. Which keyword is used to declare a constant in JavaScript?
3. What happens if you try to reassign a value to a constant?
4. Which of the following correctly declares and initializes a constant in a single statement?
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 6