JavaScript Add Element to Beginning & Ending of Array