Hi I have a javascript map
const map = new Map();
map.set("0x3D22D6A57722A566e1AD087d95daD35595818c7f" , true);
and ethereum account wallet from web3 after connect to metamask event. I want to look up the account in the map to allow certain logic
if (map.get(blockchain.account)) {
//some ops
}
console.log(blockchain.account) shows 0x3D22D6A57722A566e1AD087d95daD35595818c7f. However, whitelistMap.get(blockchain.account) always returns undefined. I have tried blockchain.account.toString() String(blockchain.account) but none of them work.
Any idea? Thanks