Typescript Check If Type Is Array Js Functions W3