|
|
|
@ -415,37 +415,33 @@ const countries = ['Finland', 'Sweden', 'Norway']
|
|
|
|
|
|
|
|
|
|
1. \*\*\* Use the countries data to find the 10 most spoken languages:
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// Your output should look like this
|
|
|
|
|
console.log(mostSpokenLanguages(countries, 10))[
|
|
|
|
|
({ English: 91 },
|
|
|
|
|
{ French: 45 },
|
|
|
|
|
{ Arabic: 25 },
|
|
|
|
|
{ Spanish: 24 },
|
|
|
|
|
{ Russian: 9 },
|
|
|
|
|
{ Portuguese: 9 },
|
|
|
|
|
{ Dutch: 8 },
|
|
|
|
|
{ German: 7 },
|
|
|
|
|
{ Chinese: 5 },
|
|
|
|
|
{ Swahili: 4 },
|
|
|
|
|
{ Serbian: 4 })
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// Your output should look like this
|
|
|
|
|
console.log(mostSpokenLanguages(countries, 3))
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// Your output should look like this
|
|
|
|
|
console.log(mostSpokenLanguages(countries, 10))
|
|
|
|
|
[
|
|
|
|
|
{'English':91},
|
|
|
|
|
{'French':45},
|
|
|
|
|
{'Arabic':25}
|
|
|
|
|
({ English: 91 },
|
|
|
|
|
{ French: 45 },
|
|
|
|
|
{ Arabic: 25 },
|
|
|
|
|
{ Spanish: 24 },
|
|
|
|
|
{ Russian: 9 },
|
|
|
|
|
{ Portuguese: 9 },
|
|
|
|
|
{ Dutch: 8 },
|
|
|
|
|
{ German: 7 },
|
|
|
|
|
{ Chinese: 5 },
|
|
|
|
|
{ Swahili: 4 },
|
|
|
|
|
{ Serbian: 4 })
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// Your output should look like this
|
|
|
|
|
console.log(mostSpokenLanguages(countries, 3))
|
|
|
|
|
[
|
|
|
|
|
{'English':91},
|
|
|
|
|
{'French':45},
|
|
|
|
|
{'Arabic':25}
|
|
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
🎉 CONGRATULATIONS ! 🎉
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<< Day 9](../09_Day_Higher_order_functions/09_day_higher_order_functions.md) | [Day 11>>](../11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md)
|
|
|
|
|
```
|
|
|
|
|