Open the Developer Tools in your browser and click on the Console tab to see the output of your JavaScript code.
Short key: Ctrl + Shift + I (Windows/Linux) or Cmd + Option + I (Mac)
A Variable is a named container used to store data values in computer memory. Variables act like labeled storage boxes where we can save text, numbers, or conditions, and safely recall or change them later as your application runs.
Creating a variable in JavaScript requires a specific keyword tool like let or const followed by a custom name. Assigning a value to that newly created name using the equals sign (=) is called initialization.
The main advantage of using the let keyword is that its stored value remains flexible. Reassignment means replacing the existing value inside the container with a brand-new value later in your code program without using the 'let' keyword again.
JavaScript is strictly case-sensitive. This means spelling a container variable name with matching letters but different casing layouts (like lowercase vs uppercase letters) creates entirely separate containers in computer storage.
When creating descriptive names using multiple words, JavaScript developers utilize camelCase. The first complete word is kept lowercase, and the first letter of every connected word that follows must start with a capital letter.
There are certain built-in words that JavaScript saves exclusively for its own internal language logic engines. You cannot use reserved names like let, const, function, or if as variable handles.
Variable names must begin with a letter, an underscore (_), or a dollar sign ($). They cannot start with digits or contain general punctuation marks like dashes or exclamation tags.