merge two strings with alternate characters javascript

Solutions on MaxInterview for merge two strings with alternate characters javascript by the best coders in the world

showing results for - "merge two strings with alternate characters javascript"
Justine
08 Nov 2019
1var m = (a, b) => a.length ? [a[0], ...m(b, a.slice(1))] : b;
2var string1 = "SCE ESG!";
3var string2 = "ERTMSAE";
4var mix = m(string1, string2);
5
6console.log(mix.join(''));