Check Variable Is Array Typescript Vs Javascript