daiToken.methods.balanceOf(senderAddress).call(function(err, res) {
if (err) {
console.log("An error occured", err);
return
}
console.log("The balance is: ",res);
})
Returns exactly what I want βresβ and it is the correct value
However when I try
daiToken.methods.balanceOf(senderAddress).call(function(err, res) {
if (err) {
console.log("An error occured", err);
return
}
return res;
})
It returns an error
I understand that the return type might be wrong, but how does console.log handle the datatype fine but if I try to cast to .toString() or BigInteger() both do not work. Neither does res.value or res.result