2 ms·
Nice writeup, thanks for sharing! I think .then((path) => { return fs.readFileAsync(path) }) should be written as.then(fs.readFileAsync). Wrapping a function i
by vnglst 10y ago
Nice writeup, thanks for sharing!
I think .then((path) => { return fs.readFileAsync(path) })
should be written as.then(fs.readFileAsync). Wrapping a function in an anonymous function doesn't really add anything - even with nice arrow notation ;-).
Dr. Boolean wrote a nice piece on this practice in Javascript: https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch2.html#a-quick-review https://drboolean.gitbooks.io/mostly-adequate-guide/content/...