Typescript Array Add If Statement