Javascript Loop Through Object Array Declaration