JavaScript: Data Types and Type Conversion

JavaScript variables are dynamically typed. That means variables do not have any fixed type, we don’t have to define/set type explicitly. The type of the variable can change during execution. For example, a variable can contain a string and then later it can contain a number, and later some other data.

JavaScript: Hoisting [ variable and function ]

Hoisting deals with variables or function usage before its definition. Hoisting happens for the variables defined with “var”. For the variables defined with “let” or constants defined with “const”, hoisting will not happen. Hoisting happens for both variables and functions.

JavaScript: Event Capturing and Bubbling [event propagation in detail]

If you are designing some event-heavy component using JavaScript, then the propagation of the event becomes very critical. Any event like “click”, “hover” etc. has 2 ways of traveling through the components. To understand the capturing and bubbling, we need to understand the params of “addEventListener” method of EventTarget. Here is the signature of “addEventListener”.

JavaScript: “use strict” – [strict mode]

“use strict” directive enables a strict operating context/mode for the code. This helps us to identify potential exceptions and makes debugging easier. In strict mode, we are notified about code that would trigger some weird behavior or fail silently. To enable the strict mode for the whole script, add the string “use strict” at the top of the script.