We're a place where coders share, stay up-to-date and grow their careers.
Why so verbose? Why not just:
const mergeArrays = (...arrays) => arrays.reduce((merged, arr) => [...merged, ...arr])
It's equally readable
Well it’s just to make the code snippet clear. As I said in the article, it could be replaced by a nice oneliner, but that’s not really the point of this article.
Why so verbose? Why not just:
It's equally readable
Well it’s just to make the code snippet clear. As I said in the article, it could be replaced by a nice oneliner, but that’s not really the point of this article.