Cannot return a value from struct

In my contract I have: struct UserByAdress { address playerAddress; uint customerBalance; bool initialized; } mapping (address => UserByAdress) private playerByAddress; function returnCustomerBalance () public view returns (uint){ return (playerByAddress[msg.sender].customerBalance); } In my frontend: function customerBalanceOnContract (){ var customerBalanceOnContract = contractInstance.methods.returnCustomerBalance(); console.log(customerBalanceOnContract); return customerBalanceOnContract; } I however do not get back an integer “customerbalance” but…

Cannot return a value from struct

In my contract I have: struct UserByAdress { address playerAddress; uint customerBalance; bool initialized; } mapping (address => UserByAdress) private playerByAddress; function returnCustomerBalance () public view returns (uint){ return (playerByAddress[msg.sender].customerBalance); } In my frontend: function customerBalanceOnContract (){ var customerBalanceOnContract = contractInstance.methods.returnCustomerBalance(); console.log(customerBalanceOnContract); return customerBalanceOnContract; } I however do not get back an integer “customerbalance” but…