Dynamic arrays
Create, change, and inspect an in-memory array.
Solidity 0.8.36REPL mode
Why use this example
Use this pattern to explore how Solidity represents typed values and how state-changing expressions affect storage. The entry isolates dynamic arrays so its input, result, and state changes stay easy to compare.
Solidity to run
uint256[] memory values = new uint256[](3)
values[0] = 4
values[1] = 5
values[2] = 6
values
values[0] + values[1] + values[2]What to expect
The run displays the memory array [4, 5, 6] and evaluates the sum of its elements as 15.
Continue the investigation
Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.
Read about state and storage Reproducible investigation