Skip to main content
added 141 characters in body
Source Link

you should use array.pop() if you want, that way the length towill be reflected-- at each iteration, delete on the other hand just reset the element to the default value.

under the hood, pop also calls delete, so you will be getting the gas refund you'd get from calling delete.

you should use array.pop() if you want the length to be reflected, delete just reset the element to the default value

you should use array.pop(), that way the length will be -- at each iteration, delete on the other hand just reset the element to the default value.

under the hood, pop also calls delete, so you will be getting the gas refund you'd get from calling delete.

Source Link

you should use array.pop() if you want the length to be reflected, delete just reset the element to the default value