Created
April 1, 2020 02:53
-
-
Save agoiabel/1b50d631dce6b46e468b22719771fa50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.3; | |
contract Mapping { | |
mapping(address => uint[]) scores; | |
function manipulateArrayMap() external { | |
scores[msg.sender].push(1); //assign a value; | |
scores[msg.sender].push(2); //assign another element | |
scores[msg.sender][0]; //access the element in the map array | |
scores[msg.sender][1] = 5; //update an element in the map array in index 1 | |
delete scores[msg.sender][0]; //delete the element in the index 0 of the map array | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment