title: Why is the API JSON object returns false when compared to the same local object in React Native
body: <p>I would like to compare the object that came from the API with the local object, however it shows false when I want to compare it in the console. The objects are the same. Why does comparing the same objects return false? And how can I get true?</p>
  <pre><code>const [QuizCategoriesData, setQuizCategoriesData] = useState([])
  
    const getData = async () =&gt; {
      const url = `https://eu-central-1.aws.data.mongodb-api.com/app/application-0-ekvws/endpoint/zdalneAPIHurraFajnie?secret=sekret&amp;arg1=Expert_1`;
      const res = await fetch(url);
      const data = await res.json();
      const filterCategory = data.filter(item=&gt; item.category === 'Mentalność bogacenia się')
      setQuizCategoriesData(filterCategory[0].data)
  
    };
  
    useEffect(() =&gt; {
      getData();
    }, []);
  
  
    const APIObject = QuizCategoriesData;
     let arr2 = [{&quot;correct_option&quot;: &quot;Jupiter&quot;,
      &quot;difficulty&quot;: &quot;easy&quot;, 
      &quot;options&quot;: [&quot;Jupiter&quot;, &quot;Saturn&quot;, &quot;Neptune&quot;, &quot;Mercury&quot;], 
      &quot;question&quot;: &quot;What’s the biggest planet in our solar system?&quot;} ];
  
    console.log('api', APIObject[0])
    console.log('local', arr2[0])
    console.log('Comprasion:',JSON.stringify(APIObject[0]) === JSON.stringify(arr2[0])) //console returns false
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ZaXmO.png" rel="nofollow noreferrer">Here are the results in a console</a></p>
  <hr />
  <p><strong>Resolved: Comparison function deep-diff worked for me.
  <a href="https://www.npmjs.com/package/deep-diff" rel="nofollow noreferrer">https://www.npmjs.com/package/deep-diff</a></strong></p>
  <p>I still don't know why the API object was different, but it's important that it works now</p>