Javascript Loop Through Array Of Objects And Check If Value Exists