Chunk a string into an array, creating a new element every length characters.
length
The string to chunk
The length of each chunk; should be a non-negative integer
The result of splitting str after every instance of length characters.
str
console.log(chunkString("123456789abc", 4)); // Output: ["1234", "5678", "9abc"]console.log(chunkString("1234567890", 4)); // Output: ["1234", "5678", "90"] Copy
console.log(chunkString("123456789abc", 4)); // Output: ["1234", "5678", "9abc"]console.log(chunkString("1234567890", 4)); // Output: ["1234", "5678", "90"]
Chunk a string into an array, creating a new element every
lengthcharacters.