My array consists of objects such as:
array = [{name: 'something'}, {name: 'random'}, {name: 'bob'}]
I have created a union type
type NamesType = 'something' | 'bob'
Can the array be filtered based on these types? So that the final result would be
array = [{name: 'something'}, {name: 'bob'}]