I use this notation quite often for encapsulating shit when I don't feel like going full OOP retard or writing a module:
const myFunc = (() => {
// internal state variables and helper functions defined here...
return (args) => {
// ...and used and/or mutated here
}
})();
[\code]
What you get a single `myFunc` function with internal state that persists across calls (but can't be accessed or mutated from the outside), and with no retarded `this` context headaches.