Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Blockchain by (12.7k points)

For example - Arrays with named indexes or hashes. Something like PHP code;

$array = array(

"foo" => "some foo value",

"bar" => "some bar value",);


1 Answer

0 votes
by (29.5k points)

There is something similar to what you're looking for it is a type called mapping:

contract MappingExample {
    mapping(address => uint) public balances;

    function update(uint newBalance) {
        balances[msg.sender] = newBalance;

you can refer the link below for more details

Browse Categories