there are many ways to achieve what you want. Basically you want to remove is and this
so either you can do this:
a. If words you want to remove are always the first and the second one then
var filteredArray = str.split(" ").splice(2);
b. If words you want to remove can be anywhere in the string
var filteredArray = str.replace(/this|is/g, function(w){
switch(w){
case 'this':
return '' ;
case 'is':
return '';
}
}).trim().split(' ');
c. There is one more lame way to do this.
var str= "This is Javascript String Split Function example ";
var parts = str.split(' ');
var clean = [];
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (part !== "This" && part !=="is")
clean.push(part);
}
d. using simple regex to replace multiple words
var str= "This is Javascript String Split Function example ";
var words = ['This', 'is'];
var text = str.replace(new RegExp('(' + words.join('|') + ')', 'g'), '').split(' ');
based on your need you can go for any one of them.
references : this , this and this