Typescript Push Element In Array Javascript Splice Method In Python