'use strict';

const countriesWithCapital = [
  ['UK', 'London'],
  ['France', 'Paris'],
  ['Germany', 'Berlin'],
  ['Switzerland', 'Bern'],
  ['Austria', 'Vienna'],
  ['Russia', 'Moscow'],
];

const capitalOf = (country) => {
  const capitalIndex = 1;
  const countryIndex = 0;
  return countriesWithCapital.find(
    (countryWithCapital) => countryWithCapital[countryIndex] === country
  )[capitalIndex];
};

console.log(capitalOf('Switzerland'));
