I\'d like to split a string only the at the first n occurrences of a delimiter. I know, I could add them together using a loop, but isn\'t there a more straight forward appr
Combination of split and join with ES6 features does this pretty neat:
split
join
let [str1, str2, ...str3] = string.split(' '); str3 = str3.join(' ');