Typescript Change Index In Array Javascript Append To List