Typescript Change Index In Array Javascript Length Of A String