Q:

Extract value of property from object in a Set? 

For the example, SomeItem is the model for an object (would be modeled as an interface in Typescript or you can just imagine that there is an item with the form of SomeItem if we are in untyped land. 
Say I have a Set: mySet = new Set([{item: SomeItem, selected: true}, ...]). 
And I want to check if itemA: SomeItem is selected or not. 
What is the cleanest way to do this? 
This did not work: 
const isSelected = mySet.has({item: itemA, selected: true});

Nor did this:
const isSelected = Array.from(mySet).includes({item: itemA, selected: true});

I'm assuming the above two did not work because it is trying to compare the objects by reference, rather than value.  
This does work: 
let isSelected: boolean;
mySet.forEach(state => {
  if (state.item === itemA) {
    isSelected = state.selected;
  }
});

But my gut tells me there is a correct way to do this. 
So,
How do I extract the value of a property of an object in a Set? 

A:

Comparing two objects with the same properties returns true only if they have the same reference, I would suggest to compare their properties as the properties are primitive values..
The array some method can be used to filter if the set contains an specific object

let mySet = new Set([{item: 'SomeItem', selected: true}]);
let itemA = "SomeItem";
let isSelected =  Array.from(mySet).some(element => element.item === itemA);
console.log(isSelected);

