let a = web3.eth.getTransactionCount(PUBLIC_KEY, "latest")
// Promise { <pending> } is assigned to a
async function get() {
let a = await web3.eth.getTransactionCount(PUBLIC_KEY, "latest")
console.log(a) // logs 48
}
let nonce = get() // Promise { <pending> } is assigned to nonce
I can't understand these situations. What is the best way to assign return value of function to variable?