Skip to content
Advertisement

Tag: array-splice

Filter an Array of strings using Filtered String and Remove from Original Array

I want to remove some elements from the array containing the word Evil (filterString). Here is what I get for the original array (guests): [‘Partner’, ‘Nice Relative 2’, ‘another evil’, ‘another one’, ‘strange Evil is here’, ‘someone Nicer’] Just want the guests array updated once the desired string (Evil) is filtered. Answer Since you want to mutate the original array

Advertisement