Variable Declaration Using const
📖 Scenario: You are creating a simple program to store information about a favorite fruit. You want to make sure the fruit name does not change accidentally.
🎯 Goal: Learn how to declare a variable using const in JavaScript and understand that its value cannot be changed later.
📋 What You'll Learn
Declare a variable using
constAssign a string value to the
const variableTry to change the value (to see what happens, but this will be commented out)
Print the value of the
const variable💡 Why This Matters
🌍 Real World
Using <code>const</code> helps keep important values safe from accidental changes in programs, like fixed settings or names.
💼 Career
Understanding <code>const</code> is essential for writing reliable JavaScript code in web development and many programming jobs.
Progress0 / 4 steps