This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -36,7 +36,13 @@
|
||||
['Russia', 'Moscow'],
|
||||
];
|
||||
|
||||
const getCapitalOf = () => {};
|
||||
const getCapitalOf = (country) => {
|
||||
return countriesWithCapital.find((elemArr) => {
|
||||
return elemArr[0] === country;
|
||||
})[1];
|
||||
};
|
||||
|
||||
console.log(getCapitalOf('Switzerland')); // => 'Bern'
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user