- Compact conditional structures
- Avoiding errors in function Inputs
- Updated DOM manipulation
- How to deal with dynamic typing
#1 — Compact conditional structures
The ternary if is a conditional structure adjacent of the already know if, else and else if. When used, the code become more lean and organized, as long you restringe its use for his function of executing tiny commands complementary of each other.
#2 — Avoiding errors in function Inputs
The function params alow default value declaration, who can avoid common errors related with null, undefined and NaN in function calls with some bad informed or missing param.
#3 — Updated DOM manipulation
#4 — How to deal with dynamic typing
The presence of a symbol of equality comparation to brute values (==) and another where types of data matters (===) next to the use of comparator typeof helps a lot in variables types management.