Arrays and mappings in solidity are the most commonly used data types to store complex data. There are trade-offs in using one over the other, and each has its own advantages. In this recipe, you will learn about common use cases for arrays and mappings.
Deciding between arrays and mappings
How to do it...
Arrays and mappings are used for a series of objects, all of which are the same size and type. Arrays store data sequentially with an incrementing index, whereas mappings store data as key-value pairs (which can also be seen as hash tables).
Arrays
Follow these steps...