There are different structure of create function in node.js. Like :
function abc(){
console.log('stackoverflow');
}
Is there any new format available and is it usefull?
There are different structure of create function in node.js. Like :
function abc(){
console.log('stackoverflow');
}
Is there any new format available and is it usefull?
function test(){}; // function declaration
var test = function(){}; // function expression
var abc = function test(){}; // named function expression
var test = (function(){ // IIFE that returns a function
return function(){}
})();
var Test = new Function(); // Function constructor
var Test = a => a * 2; // ES6 arrow function