Gunar Gessner
Mar 25, 2021
I recommend using IIFEs instead of let
s in the situation below.
Benefits:
Before:
let response; try { response = parse(req.buffer); } catch (e) { console.error(e); }
After:
const response = (() => { try { return parse(req.buffer); } catch (e) { console.error(e); } })();