Is there a way to do this? lets say :
let text = "i have three apple"
let splittedText1 = split(text, 2)
let splittedText2 = split(text, 3)
console.log(splittedText1) // ["i have", "three apple"]
console.log(splittedText2) // ["i have", "three", "apple"]
the function does split the text into section by given number, say the text 5 word, and i want to split them by 3 word, it will split the 5 word into an array of 3 string