title: My local storage is not working, I am trying to push values but I got empty
body: <p>I am fetching url with a query if the query link is available on my database it will return true, after true I will set the query link into the local storage but when I try to set local storage I got an empty value.
  I want to push query links in an array but I got this:
  <a href="https://i.stack.imgur.com/lOd6B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lOd6B.png" alt="enter image description here" /></a></p>
  <p>Here is my code:</p>
  <pre><code>  useLayoutEffect(() =&gt; {
      fetch(`http://localhost:5000/findUrl/${affiliateLink}`)
        .then(res =&gt; res.json())
        .then(data =&gt; {
          if (data.isUrlTrue) {
            const affiliate_link = localStorage.getItem('affiliate_Link')
            if (affiliate_link === null) {
              localStorage.setItem('affiliate_Link', [])
            } else {
              let old_Data = JSON.parse(affiliate_link).push(affiliateLink)
              localStorage.setItem('affiliate_Link', JSON.stringify(old_Data))
            }
  
  
          }
        })
    })
  </code></pre>