3 ms·
In that case, in javascript, i always just write a function. { init() } const init = () => { if (fail) return doSomething()
by ferzul 7y ago
In that case, in javascript, i always just write a function.
{
init()
}
const init = () => {
if (fail) return
doSomething()
}
(there's a few other cases i introduce functions for syntactic reasons in js - e.g. at the expense of a const funtion, i can convert a let to a const - but i have always found this improves the code on standard readability guides)