4 ms·
You might already know, but until do expressions land, you can use IIFEs for ifs and switches assignments: const isSomething = (() => { switch (...
by ht85 4y ago
You might already know, but until do expressions land, you can use IIFEs for ifs and switches assignments:
const isSomething = (() => {
switch (...) {
case ...:
return ...
}
})()
They are a bit ugly but the do wonders at avoiding `let`.