Mapping vs. Array in Solidity
- π»Tutorials
- π€
- βIntermediate
- π·οΈ
- π 3 years ago
There are some key differences between mapping and array in Solidity that are important to understand as you progress in your journey as a smart contract developer.
If you already have some experience as a developer, many of the terms and concepts you encounter when first diving into Solidity will hopefully be familiar to you, such as Solidity's Array type, which is very similar to arrays found in other programming languages.
However, Solidity also has a Mapping type, which may seem similar to an array at first since it is also used to store a group of data.
However, there are some key differences between mapping and array in Solidity that are important to understand as you progress in your journey as a smart contract developer.
In this article, we'll be taking a look at both types and discussing their differences, and explaining (with examples) when to use one instead of the other.