I have an array of strings in JavaScript and I want to split them into "paragraphs" by grouping them together based on blank lines. for instance:
["a", "b", "", "c", "", "d", "e", "f"] => [["a", "b"], ["c"], ["d", "e", "f"]]
It's exactly like string.split() but with an array as the input instead of a string.
Of course, I could write this function myself using a loop or maybe reduce but it sounds like quite a generic function. I'm wondering if there is anything in lodash or similar that could do it.
lodashfor it. If someone has that information, he could share. Otherwise, this could end-up as an issue for a 'feature' in lodash's github. So why do you have totake it so hard?