I'm trying to get the state for isConnected in plain JS to return true/false if the user's MetaMask is connected or not to my website. How can I do that?
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
Here you can get the address of the user if connected!