I want to do this:
["a","b","c","d"] -> ["ab","bc","cd"]
exactly like in Join elem with next one in a functional style, but in JavaScript.
Since JavaScript doesn't have a sliding
function, I'm left wondering what would be the best approach. I could do something with reduce
, but it would be messy since I'm not an expert, so I'd like some advice.