Professional Documents
Culture Documents
JS-Notes - Fundamentals PT 1
JS-Notes - Fundamentals PT 1
. A
1 variable name cannot start with a number. As this would cause aSyntaxError.
2. You cannot use a reserved keyword (ie. new) as a name for your variable.
3. As a convention you should not start your variable with a capital letter as that is mainly
used in object-oriented programming.
bjects or Primitives
O
Value can be shown as either object(“Jonas”;) or primitives(36;)
. N
1 umber-Floating point numbers- Used for decimalsand integers (ie. let age = 23;)
2. String-Sequence of characters- Used for text (ie.let firstName = “Jonas”;)
3. Boolean- Logical type that can only betrueorfalse-Used for taking decisions (ie. let
fullAge = true;)
4. U ndefined- Value taken by a variable that is not yetdefined ‘Empty value’ (ie. let
children;)
5. Null- Also means ‘Empty value’
6. Symbol (ES2015)- Value that s unique and cannot bechanged
7. Biglnt (ES2020)- Larger integers than number typecan hold.