I designed my library like this:
let name = (function() { 'use strict'; return { //То что нужно вынести }; })(); But I don’t really understand how iife works and don’t I understand it correctly?
I designed my library like this:
let name = (function() { 'use strict'; return { //То что нужно вынести }; })(); But I don’t really understand how iife works and don’t I understand it correctly?
The problem is that this question cannot be answered unambiguously.
There are guidelines like this or idiomatic .
Different companies use their guidelines:
It would be useful to read such articles. But the choice is yours. I would recommend to look at popular js libraries and do it by analogy.
Source: https://ru.stackoverflow.com/questions/870584/
All Articles
iife? - Air