javascript closures not retaining variable values from outer scope : <pre><code>.filter('asRelapsedTime', function(ConfigService) {
  var DECIMAL_STYLE = ',';

   return function(value, decimalPlaces) {
     let decimalizedNumber;
     if (decimalPlaces) {
       decimalizedNumber = value.toFixed(decimalPlaces | 0);
     } else {
       decimalizedNumber = value.toString();
     }

     decimalizedNumber = decimalizedNumber.replace('.'. DECIMAL_STYLE);

     return decimalizedNumber;
   };
});
</code></pre>

<p>From the above code, DECIMAL_STYLE should be available for use within the inner function. However it is not. What am I missing here ?</p>
