Erstelle nun dies als ein JavaScript Map-Objekt
Könntest du für mich diese Liste von Ländern mit Namen und Code in eine Zuordnung umwandeln, wobei der Code als Schlüssel und der Name als Wert verwendet wird.
Schreibe das in JavaScript.
[ 
  {name: 'Afghanistan', code: 'AF'}, 
  {name: 'Åland Islands', code: 'AX'}, 
  {name: 'Albanien', code: 'AL'}, 
  {name: 'Algerien', code: 'DZ'}, 
  {name: 'Amerikanisch-Samoa', code: 'AS'}, 
  {name: 'Andorra', code: 'AD'}, 
  {name: 'Angola', code: 'AO'}, 
  {name: 'Anguilla', code: 'AI'}, 
  {name: 'Antarktis', code: 'AQ'}, 
  {name: 'Antigua und Barbuda', code: 'AG'}, 
  {name: 'Argentinien', code: 'AR'}, 
  {name: 'Armenien', code: 'AM'}, 
  {name: 'Aruba', code: 'AW'}, 
  {name: 'Australien', code: 'AU'}, 
  {name: 'Österreich', code: 'AT'}, 
  {name: 'Aserbaidschan', code: 'AZ'}, 
  {name: 'Bahamas', code: 'BS'}, 
  {name: 'Bahrain', code: 'BH'}, 
  {name: 'Bangladesch', code: 'BD'}, 
  {name: 'Barbados', code: 'BB'}, 
  {name: 'Weißrussland', code: 'BY'}, 
  {name: 'Belgien', code: 'BE'}, 
  {name: 'Belize', code: 'BZ'}, 
  {name: 'Benin', code: 'BJ'}, 
  {name: 'Bermuda', code: 'BM'}, 
  {name: 'Bhutan', code: 'BT'}, 
  {name: 'Bolivien', code: 'BO'}, 
  {name: 'Bosnien und Herzegowina', code: 'BA'}, 
  {name: 'Botswana', code: 'BW'}, 
  {name: 'Bouvetinsel', code: 'BV'}, 
  {name: 'Brasilien', code: 'BR'}, 
  {name: 'Britisches Territorium im Indischen Ozean', code: 'IO'}, 
  {name: 'Brunei Darussalam', code: 'BN'}, 
  {name: 'Bulgarien', code: 'BG'}, 
  {name: 'Burkina Faso', code: 'BF'}, 
  {name: 'Burundi', code: 'BI'}
] Klar, hier ist, wie das in JavaScript als Objekt aussehen würde, wobei jede Eigenschaft des Objekts ein anderer Ländercode ist:

```js
const countries = {
  "AF": "Afghanistan",
  "AX": "Åland Islands",
  "AL": "Albanien",
  "DZ": "Algerien",
  "AS": "Amerikanisch-Samoa",
  "AD": "Andorra",
  "AO": "Angola",
  "AI": "Anguilla",
  "AQ": "Antarktis",
  "AG": "Antigua und Barbuda",
  "AR": "Argentinien",
  "AM": "Armenien",
  "AW": "Aruba",
  "AU": "Australien",
  "AT": "Österreich",
  "AZ": "Aserbaidschan",
  "BS": "Bahamas",
  "BH": "Bahrain",
  "BD": "Bangladesch",
  "BB": "Barbados",
  "BY": "Weißrussland",
  "BE": "Belgien",
  "BZ": "Belize",
  "BJ": "Benin",
  "BM": "Bermuda",
  "BT": "Bhutan",
  "BO": "Bolivien",
  "BA": "Bosnien und Herzegowina",
  "BW": "Botswana",
  "BV": "Bouvetinsel",
  "BR": "Brasilien",
  "IO": "Britisches Territorium im Indischen Ozean",
  "BN": "Brunei Darussalam",
  "BG": "Bulgarien",
  "BF": "Burkina Faso",
  "BI": "Burundi"
};
```
const countryList = [ 
  {name: 'Afghanistan', code: 'AF'}, 
  {name: 'Åland Islands', code: 'AX'}, 
  {name: 'Albanien', code: 'AL'}, 
  {name: 'Algerien', code: 'DZ'}, 
  {name: 'Amerikanisch-Samoa', code: 'AS'}, 
  {name: 'Andorra', code: 'AD'}, 
  {name: 'Angola', code: 'AO'}, 
  {name: 'Anguilla', code: 'AI'}, 
  {name: 'Antarktis', code: 'AQ'}, 
  {name: 'Antigua und Barbuda', code: 'AG'}, 
  {name: 'Argentinien', code: 'AR'}, 
  {name: 'Armenien', code: 'AM'}, 
  {name: 'Aruba', code: 'AW'}, 
  {name: 'Australien', code: 'AU'}, 
  {name: 'Österreich', code: 'AT'}, 
  {name: 'Aserbaidschan', code: 'AZ'}, 
  {name: 'Bahamas', code: 'BS'}, 
  {name: 'Bahrain', code: 'BH'}, 
  {name: 'Bangladesch', code: 'BD'}, 
  {name: 'Barbados', code: 'BB'}, 
  {name: 'Weißrussland', code: 'BY'}, 
  {name: 'Belgien', code: 'BE'}, 
  {name: 'Belize', code: 'BZ'}, 
  {name: 'Benin', code: 'BJ'}, 
  {name: 'Bermuda', code: 'BM'}, 
  {name: 'Bhutan', code: 'BT'}, 
  {name: 'Bolivien', code: 'BO'}, 
  {name: 'Bosnien und Herzegowina', code: 'BA'}, 
  {name: 'Botswana', code: 'BW'}, 
  {name: 'Bouvetinsel', code: 'BV'}, 
  {name: 'Brasilien', code: 'BR'}, 
  {name: 'Britisches Territorium im Indischen Ozean', code: 'IO'}, 
  {name: 'Brunei Darussalam', code: 'BN'}, 
  {name: 'Bulgarien', code: 'BG'}, 
  {name: 'Burkina Faso', code: 'BF'}, 
  {name: 'Burundi', code: 'BI'}
];

const countryMap = new Map();

for(const country of countryList) {
  countryMap.set(country.code, country.name);
}