-
|
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 nameToFavoriteNumberin this case we are going to store key of typestringand value of typeuint256.We store key/value to map like
mapVariable[key] = valuein our case
nameToFavoriteNumber [_name] = _favoriteNumber;