Add elements at the beginning of an array. The function returns the new length of the array.