|
|
|
@ -196,7 +196,27 @@ function mostUsedInitial(arr) {
|
|
|
|
|
}
|
|
|
|
|
console.log(mostUsedInitial(concatenateCountries));
|
|
|
|
|
|
|
|
|
|
// Exercises: Level 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Exercises: Level
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2. console.log(mostSpokenLanguages(countries, 10))
|
|
|
|
|
[
|
|
|
|
|
{country: 'English',count:91},
|
|
|
|
|
{country: 'French',count:45},
|
|
|
|
|
{country: 'Arabic',count:25},
|
|
|
|
|
{country: 'Spanish',count:24},
|
|
|
|
|
{country:'Russian',count:9},
|
|
|
|
|
{country:'Portuguese', count:9},
|
|
|
|
|
{country:'Dutch',count:8},
|
|
|
|
|
{country:'German',count:7},
|
|
|
|
|
{country:'Chinese',count:5},
|
|
|
|
|
{country:'Swahili',count:4}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
console.log(mostSpokenLanguages(countries, 3))
|
|
|
|
|
[
|
|
|
|
|
{country: 'English',count: 91},
|
|
|
|
|
{country: 'French',count: 45},
|
|
|
|
|
{country: 'Arabic',count: 25},
|
|
|
|
|
]
|