Trying to concat elements within in an array for example:
const x = ['1', '2', '3', '4', '5', '6']
becomes
const x = ['12', '34', '56']
The most straight-forward solution for me would be to manually loop through the array, create a new element, combining current index and index + 1, then splice the array, inserting the new element and removing the 2.
However, I am looking for something more concise if anyone has ever encountered this problem before.
Any help is v much appreciated. Thanks