Declare & Assign values to variables in JavaScript

Опубликовано: 31 Октябрь 2024
на канале: Viththiyakaran N
344
3

There are rules and conventions in naming variables in any programming
language. It is good practice to use descriptive names for variables.
You can't use space to separate characters.
userName not user Name

*Capitalize the first letter of every word except the first
salesTax or userFirstName

To assign values to variables, add an equal sign and the value:
var userName = "Smith"
var price = 100