how to split a string into chunks nodejs

Solutions on MaxInterview for how to split a string into chunks nodejs by the best coders in the world

showing results for - "how to split a string into chunks nodejs"
Celia
15 Apr 2019
1function chunkString(str, length) {
2  return str.match(new RegExp('.{1,' + length + '}', 'g'));
3}
4