JSFiddle - React, Tailwind, and code Playground
JavaScript
var testArray = [ 'this one contains IN', 'this one does not' ];
function filterArray ( arr ) {
var i = arr.length;
while (i--) {
if (arr[i].indexOf('IN') < 0) {
arr.splice(i, 1);
}
}
}
filterArray( testArray );
document.body.innerText = JSON.stringify(testArray);