To remove an element from a list, with JavaScript Lodash, we use the remove method.
For instance, we write
_.remove(subTopics, (currentObject) => {
return currentObject.subTopicId === stToDelete;
});
to call remove to remove the item in the subTopics array that has the subTopicID equals stToDelete by calling it with the callback that returns the condition.