title: Can I expect this value to be cached by a JavaScript engine?
body: <p>Inside a function I have the lines</p>
  
  <pre><code>     var deal_date = new Date(deal.Created),
            cur_date = new Date(), 
     num_days_passed = Math.floor((cur_date - deal_date) / (1000*60*60*24));
  </code></pre>
  
  <p>and I'm wondering whether, since it's in a function, the value of the computation <code>1000*60*60*24</code> will be cached by the JavaScript engine. Because otherwise I have to get rid of the magic number by defining some constant</p>
  
  <pre><code>window.SECONDS_PER_DAY = 1000*60*60*24;
  </code></pre>
  
  <p>and over time it gets laborious to create all this extra code, especially when <code>1000*60*60*24</code> is in fact more descriptive to someone reading the code (unless they're an idiot).</p>