Array soliditas
// Create array
address[] addresses
uint256[] myArray
// Add to array
function add() internal {
myArray.push(123);
}
// Remove from array
function removeUnordered() internal {
myArray[index] = myArray[myArray.length - 1];
myArray.pop();
}
function removeOrdered() internal {
// WARN: This unbounded for loop is an anti-pattern
for(uint256 i = index; i < myArray.length-1; i++){
myArray[i] = myArray[i+1];
}
myArray.pop();
}
Jos