Skip to content

The logic behind declarations behind mappings #15

Answered by vivart
gmluqa asked this question in Q&A
Discussion options

You must be logged in to vote

mapping data type stores data in the form of key value pair.
mapping(string => uint256) public nameToFavoriteNumber in this case we are going to store key of type string and value of type uint256.
We store key/value to map like
mapVariable[key] = value
in our case nameToFavoriteNumber [_name] = _favoriteNumber;

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gmluqa
Comment options

@PatrickAlphaC
Comment options

Answer selected by gmluqa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants