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