javascript check if object with property exists in array