For those who stumble on this.
Translated from Python to JavaScript.
function nthsplit(line,n){
var i;
var arr = [];
for(i=0;i<line.length;i+=n){
arr.push(line.substring(i,i+n));
}
return arr;
}
Code originally found on StackOverFlow posted by Satomacoto