Expression: It is a collection of operands and operators
Example: a=a+b;
Operator: An operator is a kind of expression-related thing that operates on operands.
Variable :
- Variables are used to store the data.
- to declare a variable in JavaScript with the help of the var, let, and const keywords.
- The let and const keywords were introduced in the ES6 version.
- Example: integer, string, Boolean, array.
Rules :
- Variable names contain only A-Z, a-z, numbers, and underscore symbols.
- Variables should not start with digits. Variable names are case-sensitive.
- can't use reserved keywords like while, for, if, etc.
- Use descriptive, relevant names instead of a, b, or abs, etc.
- Use camelcase pattern.
Variable declaration :
Syntax: Var variable_name;
Example: var name ;