chapter10-code-3

PHOTO EMBED

Thu Mar 30 2023 10:02:44 GMT+0000 (Coordinated Universal Time)

Saved by @RareSkills

contract ExampleContract {
	
	uint256[] public myArray;

	function removeAt(uint256 index) public {
		delete myArray[index];
		// sets the value at index to be zero

		// the following code is equivalent
		// myArray[index] = 0;

		// myArray.length does not change in either circumstance
	}
}
content_copyCOPY