'Combining subsequent elements of an array in Javascript

I have an array as following:

arr1 = CP-en,AR-es,CP-en,BE-fr,CP-en,CZ-cs

How do I combine the array's subsequent elements so I get the following result:

result = CP-en+AR-es, CP-en+BE-fr, CP-en+CZ-cs



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source