Javascript Loop Through Nested Array C