Typescript Remove Last Element In Array Python Definition