Typescript Empty Array Undefined In Javascript