i am using my_colors.split(" ") method, but i want to split or divide string in fixed number of words e.g each split occurs after 10 words or so ...how to do this in javascript?
Try this - this regex captures groups of ten words (or less, for the last words):
var groups = s.match(/(\S+\s*){1,10}/g);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With