Typescript Slice Array Js Push Method In Python