The Complete JavaScript Course 2025
High-level object-oreinted multi-paradigm programming language
VERSIONS:
ES6 is Modern Javascript (2015)
Values and Variables
- Never use: function. new or name as variables. Prefix with _ or $ to use.
- useCamelCase
Data Types
Every value is either OBJECT or PRIMITIVE
PRIMITIVE DATATYPES:
- Number (floating point numbers)
- Strings (sequence of characters
- Boolean (true / false)
- Undefined (empty value)
- Null (empty value)
- Symbol (ES2015) – Unique cannot be changed
- BigInt – Massive numbers
Javascript has dynamic typing – it automatically assigns data type.
typeof – used to display what data type the variable is.
Declaring variables
var is legacy, use let or const. Use const where possible.
Use let if the variable can change.
Use const if the value of the variable cannot be changed (immutable) (also cannot be empty).
Operators
math (+ – / * x**y), assignment (= += -= *= ++ –), comparison (<> ===)
OPERATOR PRECEDENCE
| Precedence | Associativity | Individual operators | Notes |
|---|---|---|---|
| 18: grouping | n/a | Grouping(x) |
[1] |
| 17: access and call | left-to-right | Member accessx.y |
[2] |
Optional chainingx?.y |
|||
| n/a | Computed member accessx[y] |
[3] | |
new with argument listnew x(y) |
[4] | ||
Function callx(y) |
|||
import(x) |
|||
| 16: new | n/a | new without argument listnew x |
|
| 15: postfix operators | n/a | Postfix incrementx++ |
[5] |
Postfix decrementx-- |
|||
| 14: prefix operators | n/a | Prefix increment++x |
[6] |
Prefix decrement--x |
|||
Logical NOT!x |
|||
Bitwise NOT~x |
|||
Unary plus+x |
|||
Unary negation-x |
|||
typeof x |
|||
void x |
|||
delete x |
[7] | ||
await x |
|||
| 13: exponentiation | right-to-left | Exponentiationx ** y |
[8] |
| 12: multiplicative operators | left-to-right | Multiplicationx * y |
|
Divisionx / y |
|||
Remainderx % y |
|||
| 11: additive operators | left-to-right | Additionx + y |
|
Subtractionx - y |
|||
| 10: bitwise shift | left-to-right | Left shiftx << y |
|
Right shiftx >> y |
|||
Unsigned right shiftx >>> y |
|||
| 9: relational operators | left-to-right | Less thanx < y |
|
Less than or equalx <= y |
|||
Greater thanx > y |
|||
Greater than or equalx >= y |
|||
x in y |
|||
x instanceof y |
|||
| 8: equality operators | left-to-right | Equalityx == y |
|
Inequalityx != y |
|||
Strict equalityx === y |
|||
Strict inequalityx !== y |
|||
| 7: bitwise AND | left-to-right | Bitwise ANDx & y |
|
| 6: bitwise XOR | left-to-right | Bitwise XORx ^ y |
|
| 5: bitwise OR | left-to-right | Bitwise ORx | y |
|
| 4: logical AND | left-to-right | Logical ANDx && y |
|
| 3: logical OR, nullish coalescing | left-to-right | Logical ORx || y |
|
Nullish coalescing operatorx ?? y |
[9] | ||
| 2: assignment and miscellaneous | right-to-left | Assignmentx = y |
[10] |
Addition assignmentx += y |
|||
Subtraction assignmentx -= y |
|||
Exponentiation assignmentx **= y |
|||
Multiplication assignmentx *= y |
|||
Division assignmentx /= y |
|||
Remainder assignmentx %= y |
|||
Left shift assignmentx <<= y |
|||
Right shift assignmentx >>= y |
|||
Unsigned right shift assignmentx >>>= y |
|||
Bitwise AND assignmentx &= y |
|||
Bitwise XOR assignmentx ^= y |
|||
Bitwise OR assignmentx |= y |
|||
Logical AND assignmentx &&= y |
|||
Logical OR assignmentx ||= y |
|||
Nullish coalescing assignmentx ??= y |
|||
| right-to-left | Conditional (ternary) operatorx ? y : z |
[11] | |
| right-to-left | Arrowx => y |
[12] | |
| n/a | yield x |
||
yield* x |
|||
Spread...x |
[13] | ||
| 1: comma | left-to-right | Comma operatorx, y |
