-
Hello, I am 2hr40 mins deep in the Javascript Edition course so far, my doubt is related to the following lines:
Specifically, Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
mapping data type stores data in the form of key value pair. |
Beta Was this translation helpful? Give feedback.
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 typestring
and value of typeuint256
.We store key/value to map like
mapVariable[key] = value
in our case
nameToFavoriteNumber [_name] = _favoriteNumber;