3 ms·
You know instead of: const getObj = (id, store) => { return { id } } You could write: const getObj = (id, store) => ({ id })
by gidan 10y ago
You know instead of:
const getObj = (id, store) => { return { id } }
You could write:
const getObj = (id, store) => ({ id })
- i__believe 10y agoI'm pretty sure that's a good illustration of my point.
- dwaltrip 10y agoThis is a matter of personal preference. I find `return` to be quite distracting and annoying for a small function that spans part of a line, while you and some others may prefer the explicitness of the `return` keyword. I would agree that nested destructuring should be used quite cautiously. Code legibility is incredibly important to the success of any serious project.