I have an array called arr[].
I want to remove an array item (so I guess splice) that contains certain text.
So say one of the array items is:
"this is the array item 60894 thank you"
I want to be able to just put in 60894 and have that entire item removed from the array.
I know this involves splice, and maybe indexOf, but I can't seem to get the syntax just right.
I've found other solutions that show a loop through the entire array; just wondering if I can do a one-off line instead of that.
Thanks...
arr = arr.filter(function(a){ return a.indexOf('60894') == -1; });splice()and modifiyng the array in place -> jsfiddle.net/dtkjj9d9