Typescript Count Array Python Methods