Typescript Check If Array Is Empty Javascript