Typescript Empty Array Length Javascript Method Syntax Python