Passing by value

When a value type variable is assigned to another variable or when a value type variable is sent as an argument to a function, EVM creates a new variable instance and copies the value of original value type into target variable. This is known as passing by value. Changing values in original or target variables will not affect the value in another variable. Both the variables will maintain their independent, isolated values and they can change without the other knowing about it.

Get Solidity Programming Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.