Typescript Count Array Javascript Appendchild