Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const indexMe = 1; // me
- const indexSimilar = 2; // similar
- const indexDifferent = 3; // different
- const allStacksObj = Object.values(window?.stage?.pole?.obj || {});
- const stackMe = allStacksObj[indexMe];
- const stackSimilar = allStacksObj[indexSimilar];
- const stackDifferent = allStacksObj[indexDifferent];
- const meKeysDiff = Object.keys(stackMe).filter(
- (k) => stackMe[k] === stackSimilar[k] && stackMe[k] !== stackDifferent[k]
- );
- const diffStackKeysDiff = Object.keys(stackDifferent).filter(
- (k) => stackDifferent[k] !== stackMe[k] && stackDifferent[k] !== stackSimilar[k] && stackSimilar[k] === stackMe[k]
- );
- const allKeysDiff = new Set(meKeysDiff.concat(diffStackKeysDiff));
- console.log(
- 'me: ',
- stackMe.nametxt,
- stackMe.x,
- stackMe.y,
- 'similar: ',
- stackSimilar.nametxt,
- stackSimilar.x,
- stackSimilar.y,
- 'different: ',
- stackDifferent.nametxt,
- stackDifferent.x,
- stackDifferent.y,
- allKeysDiff
- );
Advertisement
Add Comment
Please, Sign In to add comment