This function adds an element to the end of an array.