Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created April 1, 2020 02:53
Show Gist options
  • Save agoiabel/1b50d631dce6b46e468b22719771fa50 to your computer and use it in GitHub Desktop.
Save agoiabel/1b50d631dce6b46e468b22719771fa50 to your computer and use it in GitHub Desktop.
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