var arr = [];
var str='This is mWORDy word docuWORDment';
if (str.indexOf('WORD') > -1) {
arr.push(Whole word here)
}
This works but I need to push the whole words that contains WORD into the array.
So the result should be this:
arr['mWORDy','docuWORDment'];
How can I do this?