10 replies
1 recast
20 reactions
We're gonna start with variables. Mind you. I'm gonna give you the definitions in a clear, short and concise way.
Cause we gonna learn this in 5 mins .. hehe
πΉ Variables
β‘ Use let and const for block-scoped variables
β‘ Use var (function-scoped; avoid in modern code)
β‘ const is used for constants (cannot be reassigned)
β‘ Variable names must start with a letter, _, or $
πΉ Data Types
β‘ Primitive Types: string, number, boolean, null, undefined, symbol, bigint
β‘ Reference Types: object, array, function
β‘ Use typeof to check type
πΉ Operators
β‘ Arithmetic: +, -, *, /, %, **
β‘ Assignment: =, +=, -=, *=, /=, etc.
β‘ Comparison: ==, ===, !=, !==, >, <, >=, <=
β‘ Logical: &&, ||, !
β‘ Ternary: condition ? true : false
β‘ Nullish Coalescing: ??
πΉ Control Flow
β‘ if, else if, else for conditionals
β‘ switch for multiple conditions
β‘ for, while, do...while for loops
β‘ break exits a loop, continue skips an iteration 0 reply
0 recast
0 reaction