Typescript Change Position In Array Javascript Length