It’s simple to compare primitive values in JavaScript. What you need to do is use any of the available eqality operators, for example the strict equality operator:

‘a’ === ‘c’; // => false
1 === 1; // => true
Objects have structured data, thus they are more difficult to compare. In this post, you will learn how to correctly compare objects in JavaScript.

#javascript #equality #object

How to Compare Objects in JavaScript
3.55 GEEK