I detected I made an error and used "}());" instead of "})();" and the code worked just fine which is how it went undetected. I'm wondering if there is a difference? Due to copy and paste this error is in a lot of separate scripts which makes me worried but confused since ESLint didn't complain. I've tried to find an answer but google doesn't give any results when searching for "}());" and "javascript wrong function closure" gives results hinting that they are both the same, no difference. The functions looks like this:
const fname = (function() {
const cached_func = ...;
return function(p1, p2) {
...
return cached_func.apply(this, arguments)
};
}()); <- The error