Open martoio opened 4 years ago
If you are keen on learning something cool, Node.JS modules are technically IIFEs behind the scenes: https://medium.com/better-programming/node-js-modules-basics-to-advanced-2464001229b6
So wrapping a module in an IIFE is the same as putting an IIFE in another IIFE - no real benefit
There's no actual benefit to having the IIFE, and it just makes your code harder to understand:
https://github.com/webwizard99/salt-store-backend/blob/dc880294543b5bbce10963657e84ac953de71e56/utilities/storeitems.js#L1-L43
This does the same thing: