Saturday, October 29, 2022

JavaScript Functions as JavaScript Variables

In Javascript instead of declaring and executing a function in two different steps.
for example
step 1 - 
function add(a,b){return a+b;}
step 2-
add(3,4);
result 7

Javascript provides an approach to declare and execute the function immediately. Which is known as IIFE(Immediately Invoked Function Expression)

Example:
(
function add(x,y){
alert(x+y);
})();

No comments:

Post a Comment

methods available in Dapper

  Dapper is a micro ORM library for .NET and .NET Core applications that allows you to execute SQL queries and map the results to objects. D...