Javascript Loop Through Array Of Objects And Update Values In A Dictionary