Typescript Change Index In Array Javascript Appendchild