[SOLVED] Catching an eth Address from an array of addresses

I am trying to find out if an address is included within an array. No success yet with the following code.

const queryUser = data[0].get("accounts");
console.log("queryUser:", queryUser)

const web3 = await Moralis.enableWeb3();
const address = (await web3.listAccounts())[0];
console.log("currentAddress2:", address);

const containsEth = queryUser.includes(address);
console.log("includes", containsEth)

This is I get in return:

As you can see, address is identical. But it returns me false. How can I fix this?

I have to covert it to lower case with toLowerCase()

1 Like