javascript filter undefined from array