I have a long javascript string. I am trying to break it into an array with every x combination of consecutive words. So for example if my array
var string = 'This is my example string'
and my x was equal to 3 I would get something like:
['This', 'This is', 'This is my', 'is', 'is my', 'is my example', 'my', 'my example', 'my example string', 'example string', 'string']
So like, every combination of up to three words. I am using this as an index to do fuzzy text matching on.