splitFrom logic

[matchAll, reduce]を経由してpattern(1 length delimiter)からsplit。
冗長なスライスなし。

how to use splitFrom

define String.prototype

1. declare values
const vs=[]

2. set values
vs.length=1+this.length-this.matchAll(RegExp(pattern,`g`)).reduce((a,v)=>a+(vs[v.index-a]=v[0]).length,0)

3. return
return vs