title: Use a variable outside of a function in Cypress
body: <p>I want to use a value that i got from a website and stored in a variable outside of a &quot;within&quot; function to comapre it with another value.</p>
  <pre><code>cy.get('.TableCloumn_3')
      .within($tr =&gt; {
       cy.get('[class=&quot;ng-star-inserted&quot;]').then(($span) =&gt; {
  
      const relRep = $span.text();
     
       cy.log(relRep);
        })
      })
      
    
     cy.log(relRep) 
      
    })
  </code></pre>
  <p>The first cy.log for relRep prints me the value but the second one does not. When I change from it from cont to var it also gives me an empty log. How can i use this value outside the function?</p>