What is the arrow function alternative to this function ?
function(entry) {
//
}(entry);
I tried some things like below, but it's not the correct way :
entry => {
//
}(entry)
What is the arrow function alternative to this function ?
function(entry) {
//
}(entry);
I tried some things like below, but it's not the correct way :
entry => {
//
}(entry)
Maybe you are mentioning IIFE (Immediately Invoked Function Expression)
;(function (entry) {
console.log(entry)
})("abc")
;((entry) => {
console.log(entry)
})("def")
Take a look at the two examples provided at MDN Web Docs: Arrow Functions.
Function styling...
function (a){
return a + 100;
}
Arrow functions...
(a) => {
return a + 100;
}
Your code should then just work with...
entry => {
//
}
As mentioned by others, your syntax is probably based on an IIFE (Immediately Invoked Function Expression) statement.