Bytes storage members
Push, index, and pop individual bytes in dynamic storage.
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 bytes storage members so its input, result, and state changes stay easy to compare.
Solidity to run
bytes public data
data.push(0x12)
data.push(0x34)
bytes1 removed = data[data.length - 1]
data.pop()
removed
data.length
data[0]Official Solidity reference
Compare this focused investigation with the complete language definition in the Solidity documentation.
Bytes membersWhat to expect
The removed byte remains 0x34 while the storage byte array shrinks to one item containing 0x12.
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