Typescript Remove Last Element In Array Python Size Of List