Helper methods for getting head, tail and initial of an array.