1

I tried to search for an answer but without even knowing what this is called, not really sure what to search for. I am curious as to the full purpose of using a function like this. I know the fat arrow part of it is an anonymous function.

((() => {
    // code
}))();
Ian
  • 15
  • 1
  • 7

1 Answers1

1

It's called Immediately Invoked Function Expression, or IIFE in short. It's mostly used to avoid polluting the global namespace. You can read more about it here: https://developer.mozilla.org/en-US/docs/Glossary/IIFE

anonDelta
  • 37
  • 9