scripts/closures01.js
// Function retirement - Calculate the years before one's retirement

Function retirement - Calculate the years before one's retirement
Function retirement - Calculate the years before one ' s retirement
function retirement(retireAge) {
  var a = ' years before retirement.';
  return function (birthYear) {
    var age = 2020 - birthYear;
    console.log((retireAge - age) + a);
  }
}
function retirement ( retireAge ) { var a = ' years before retirement.' ; return function ( birthYear ) { var age = 2020 - birthYear ; console . log ( ( retireAge - age ) + a ) ; } }
Function retirement - Calculate the years before one's retirement
Function retirement - Calculate the years before one ' s retirement