Typescript Array Get Last Element From Array Python Methods That Only Takes