ES6 block-scope variable usage
let and const allows us to declare block scoped variable. In your code 

if (imperialCountries.indexOf(country) === -1) {
  var units = 'metric';
} else {
  units = 'imperial';
}


when you replace var with let the variable units becomes a block scoped variable and is recognized only inside the if block. You can make the following change in your code to use let:

let units;
if (imperialCountries.indexOf(country) === -1) {
  units = 'metric';
} else {
  units = 'imperial';
}