Javascript Loop Through Object Array Creation C