Typescript Last Element Of Array Javascript Push Function In Python