Deletes the element at index
from an array
The array will be resized, so that the deleted element doesn't leave a gap.
arrayDeleteAt(array, index)
→ returns boolean
someArray.deleteAt(index)
Uses the arrayDeleteAt function to delete the value in specific position
someArray = ["Red", "White", "Green", "Blue", "Pink"];
arrayDeleteAt(someArray, 3);
writeOutput(serializeJSON(someArray));
Expected Result: ["Red", "White", "Blue", "Pink"]
CF 11+ Lucee 4.5+ Uses the member function is the same as running arrayDeleteAt.
someArray = ["Red", "White", "Green", "Blue", "Pink"];
someArray.DeleteAt(2);
writeOutput(serializeJSON(someArray));
Expected Result: ["Red", "Green", "Blue", "Pink"]
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.