How to check an Object if value exists JavaScript?

In objectItems variable has some array of items. I have checked and compaire productId exists and productId equal 2 in object objectItems?

Related Answers