Reduce fn that joins neighboring strings
Given an array of strings, returns a new array where all neighboring strings have been joined.
let arr = ["foo", "bar", 1, "baz", "", "qux" ];arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ] Copy
let arr = ["foo", "bar", 1, "baz", "", "qux" ];arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
Reduce fn that joins neighboring strings
Given an array of strings, returns a new array where all neighboring strings have been joined.
Example: