Hoisting in Javascript.

Hoisting is JavaScript’s default behavior of moving all declarations to the top of the current scope (to the top of the current script or the current function). In JavaScript, a variable or function can be declared after it has been used. In other words; a variable or function can be used before it has been […]

Read More

Closures in Javascript.

According to Mozilla Developer Network: Closures are functions that refer to independent (free) variables. In other words, the function defined in the closure ‘remembers’ the environment in which it was created. Another short description: Whenever you see the function keyword within another function, the inner function has access to variables in the outer function. That […]

Read More