Typescript Type Array Of Objects In Javascript Methods And Functions