Typescript Last Item In Array Python Question