Count Objects In Array Javascript Appendchild