check if property value exists in array of objects javascript