Javascript Fundementals (Part 1)

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 access
x.y
[2]
Optional chaining
x?.y
n/a Computed member access
x[y]
[3]
new with argument list
new x(y)
[4]
Function call
x(y)
import(x)
16: new n/a new without argument list
new x
15: postfix operators n/a Postfix increment
x++
[5]
Postfix decrement
x--
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 Exponentiation
x ** y
[8]
12: multiplicative operators left-to-right Multiplication
x * y
Division
x / y
Remainder
x % y
11: additive operators left-to-right Addition
x + y
Subtraction
x - y
10: bitwise shift left-to-right Left shift
x << y
Right shift
x >> y
Unsigned right shift
x >>> y
9: relational operators left-to-right Less than
x < y
Less than or equal
x <= y
Greater than
x > y
Greater than or equal
x >= y
x in y
x instanceof y
8: equality operators left-to-right Equality
x == y
Inequality
x != y
Strict equality
x === y
Strict inequality
x !== y
7: bitwise AND left-to-right Bitwise AND
x & y
6: bitwise XOR left-to-right Bitwise XOR
x ^ y
5: bitwise OR left-to-right Bitwise OR
x | y
4: logical AND left-to-right Logical AND
x && y
3: logical OR, nullish coalescing left-to-right Logical OR
x || y
Nullish coalescing operator
x ?? y
[9]
2: assignment and miscellaneous right-to-left Assignment
x = y
[10]
Addition assignment
x += y
Subtraction assignment
x -= y
Exponentiation assignment
x **= y
Multiplication assignment
x *= y
Division assignment
x /= y
Remainder assignment
x %= y
Left shift assignment
x <<= y
Right shift assignment
x >>= y
Unsigned right shift assignment
x >>>= y
Bitwise AND assignment
x &= y
Bitwise XOR assignment
x ^= y
Bitwise OR assignment
x |= y
Logical AND assignment
x &&= y
Logical OR assignment
x ||= y
Nullish coalescing assignment
x ??= y
right-to-left Conditional (ternary) operator
x ? y : z
[11]
right-to-left Arrow
x => y
[12]
n/a yield x
yield* x
Spread
...x
[13]
1: comma left-to-right Comma operator
x, y

Leave a Reply

Your email address will not be published. Required fields are marked *