title: How to define value of variable from one function to another?
body: <p>Hello i have this function for example:</p>
  
  <pre><code>var dt = new Date(); 
  var now = dt.valueOf(); 
  function date1() { 
    var d1 = Math.ceil(
      (Math.abs(now - dt.setUTCFullYear(2005))) / (1000*3600*24*365)
    ); 
  }
  </code></pre>
  
  <p>And i want to get value from d1 var to another function for example:</p>
  
  <pre><code>function res() { 
    document.write(d1).value; 
  }
  </code></pre>