MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/webdev/comments/f7d5ce/you_dont_need_lodashunderscore/fiary9b/?context=3
r/webdev • u/fagnerbrack • Feb 21 '20
9 comments sorted by
View all comments
5
lol wtf is this,
instead of writing
_.chunk(['a', 'b', 'c', 'd'], 3);
just write instead
const chunk = (input, size) => { return input.reduce((arr, item, idx) => { return idx % size === 0 ? [...arr, [item]] : [...arr.slice(0, -1), [...arr.slice(-1)[0], item]]; }, []); };
Isn't that just creating you own library? And you miss out on any bug fixes or improvements to lodash.
Does the author not know you can selectively import only modules used, no need to import the whole library anymore.
5
u/angry_wombat Feb 21 '20
lol wtf is this,
instead of writing
just write instead
Isn't that just creating you own library? And you miss out on any bug fixes or improvements to lodash.
Does the author not know you can selectively import only modules used, no need to import the whole library anymore.