JavaScript

Functions in JavaScript

In JavaScript, there are several type of functions based on how they are defined and used. Function Declaration Defined using the function keyword, followed by the function name and block of code. Function declarations are hoisted to the top of their scope, allowing...

read more

Debouncing

Debouncing Debouncing is a programming technique used to limit the number of invocations of a time-consuming function in order to improve the application performance. const debounce = (func, delay) => { let timerId = null; if (timerId) { clearTimeout(timerId); }...

read more

Hoisting in JavaScript

Hoisting is a principle of JavaScript by which we are able to access variables and function even before they are explicitly declared in the code. It is a behaviour where variables and functions appear to have been moved to the top of their containing scope during the...

read more

Deep Copy and Shallow Copy

When it comes to copying objects or arrays in programming, there are two common approaches: deep copy and shallow copy. Shallow Copy Shallow copying creates a new object and copies the references of the original elements. It means that the copied object refers to the...

read more

Equality in JavaScript

In JavaScript, both `==` and `===` are comparison operators used to compare values. However, they have different meanings and behaviours. Loose Equality Check `==` is the loose equality operator. It checks for equality between two values, allowing for type conversion....

read more

REST and SPREAD Operators

REST and SPREAD operators are two distinct features of ES6 that were introduced to make working with arrays and objects more convenient. Rest Operator The REST operator is used in function parameters to capture multiple function arguments into a single array. It...

read more