Split string with limit, where last string contains the remainder
This is slightly different from taking the rest as is, but this was useful in my case:
const [a, ...b] = 'foo/bar/baz'.split('/');
// => a: 'foo', b: ['bar', 'baz']
var str = 'hello_world_there';
var parts = str.split('_');
var p1 = parts[0];
var p2 = parts.slice(1).join('_');
This will do an ordinary split, but then merge everything past the first match.