splitFrom logic

split from pattern(1 length delimiter) via [matchAll, reduce].
no redundant slice.

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