Typescript Array Add If Condition