I want to store 21 char in an array from a string. my problem is when I'm writing a paragraph it cuts the word like this.
let string = "This is a new paragraphe that i'm writing to you" // 48 chars and 10 words
let lines = string.match(/.{1,21}/g)
console.log(lines) // ["This is a new paragra", "phe that i'm writing ", "to you"]
I want it to look like this ["This is a new" , "paragraphe that i'm" , "writing to you"] and don't cut the word.