Typescript If Array Is Not Empty In Js