Typescript Array Shift Undefined