Very basic question but would appreciate any help understanding this. I don't quite understand the logic behind the += operator within the below mapping. Please see below code
function getBalance() public view returns(uint) {
return address(this).balance;
}
function sendMoney() public payable {
balanceReceived[msg.sender] += msg.value;
}
How can you logically add and assign and have - balanceReceived [msg.sender] = balanceReceived [msg.sender] + msg.value?
I am sure I am looking at this the wrong way but the balanceRecieved [msg.sender] is a address so how can you add that to a uint value of msg.value?