My Blog

My WordPress Blog

My Blog

My WordPress Blog

Month: July 2025

Function bind() Method

Function bind() Method The function bind() method in JavaScript creates a new function with a specified this value and optional arguments, without invoking the original function immediately. It is commonly used to set the context (this) for a function and partially apply arguments. This method is used to bind a particular object to a common function. To understand the […]

Function apply() Method

Function apply() Method The Function apply() method in JavaScript allows us to invoke a function given a specific value for this and arguments provided as an array. The Function call() and apply() methods are very similar, but the main difference between them is function apply() method takes a single array containing all function arguments, and the function call() method […]

Function Invocation

Function Invocation The function invocation in JavaScript is the process of executing a function. A JavaScript function can be invoked using the function name followed by a pair of parentheses. When you write a function code in JavaScript, it defines the function with expressions and statements. Now, to evaluate these expressions, it is necessary to invoke the […]

Arrow Functions

Arrow Functions The arrow functions in JavaScript allow us to create a shorter and anonymous function. Arrow functions are written without “function” keyword. The JavaScript arrow functions are introduced in ES6. Before ES6, we can define a JavaScript function with function declaration or function expression. The function expressions are used to define anonymous functions. The arrow functions allow us to write the function expressions […]

Self-Invoking Functions

Self-Invoking Functions The self-invoking functions are JavaScript functions that execute immediately as they are defined. To define a self-invoking function, you can enclose an anonymous function within parentheses followed by another set of parentheses. These are also called self-executing anonymous functions. The anonymous function inside the first pair of parentheses is basically a function defined […]

Function() Constructor

The Function() Constructor The JavaScript Function() constructor can dynamically create a function object at the run time. The functions created using Function() constructor have global scope only. The Function() constructor can be used to define the function at the run time, but you should use the Function() constructor with caution as it can lead to vulnerabilities in […]

Function Parameters

Function Parameters and Arguments The function parameters in JavaScript are variables listed inside the parentheses in the function definition. A function can have multiple parameters separated by commas. The function arguments are the values that are passed to function when it is called. We define function listing the parameters and call the function passing the arguments. The number of […]

Scroll to top