good stuff but something was mis-transcribed. This line can't possibly work
for (const i = data.length; i-- > 0; ) { for (const i = data.length; i-- > 0; ) {Whoops, good catch! That's definitely an error on my part. The original code uses `var` there. Thanks for pointing it out.