Javascript Loop Through Array Foreach