remove undefined from array typescript