split every n character js

JavaScript
var str = 'abcdefghijkl';
console.log(str.match(/.{1,3}/g));
Source

Also in JavaScript: