77 <img alt =" Twitter Follow " src =" https://img.shields.io/twitter/follow/asabeneh?style=social " >
88 </a >
99
10- <sub >Author:
11- <a href =" https://www.linkedin.com/in/asabeneh/ " target =" _blank " >Asabeneh Yetayeh</a ><br >
12- <small > January, 2020</small >
13- </sub >
10+ <sub >Author:
11+ <a href =" https://www.linkedin.com/in/asabeneh/ " target =" _blank " >Asabeneh Yetayeh</a ><br >
12+ <small > January, 2020</small >
13+ </sub >
14+
1415</div >
1516
1617[ << 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 )
@@ -67,7 +68,7 @@ const languages = [
6768 ' French' ,
6869 ' Spanish' ,
6970 ' English' ,
70- ' French'
71+ ' French' ,
7172]
7273
7374const setOfLangauges = new Set (languages)
@@ -88,7 +89,7 @@ const languages = [
8889 ' French' ,
8990 ' Spanish' ,
9091 ' English' ,
91- ' French'
92+ ' French' ,
9293]
9394
9495const setOfLangauges = new Set (languages)
@@ -183,7 +184,7 @@ const languages = [
183184 ' French' ,
184185 ' Spanish' ,
185186 ' English' ,
186- ' French'
187+ ' French' ,
187188]
188189const langSet = new Set (languages)
189190console .log (langSet) // Set(4) {"English", "Finnish", "French", "Spanish"}
@@ -193,19 +194,19 @@ const counts = []
193194const count = {}
194195
195196for (const l of langSet) {
196- const filteredLang = languages .filter (lng => lng === l)
197+ const filteredLang = languages .filter (( lng ) => lng === l)
197198 console .log (filteredLang) // ["English", "English", "English"]
198199 counts .push ({ lang: l, count: filteredLang .length })
199200}
200201console .log (counts)
201202```
202203
203204``` js
204- [
205+ ; [
205206 { lang: ' English' , count: 3 },
206207 { lang: ' Finnish' , count: 1 },
207208 { lang: ' French' , count: 2 },
208- { lang: ' Spanish' , count: 1 }
209+ { lang: ' Spanish' , count: 1 },
209210]
210211```
211212
@@ -254,7 +255,7 @@ let b = [3, 4, 5, 6]
254255let A = new Set (a)
255256let B = new Set (b)
256257
257- let c = a .filter (num => B .has (num))
258+ let c = a .filter (( num ) => B .has (num))
258259let C = new Set (c)
259260
260261console .log (C )
@@ -276,7 +277,7 @@ let b = [3, 4, 5, 6]
276277let A = new Set (a)
277278let B = new Set (b)
278279
279- let c = a .filter (num => ! B .has (num))
280+ let c = a .filter (( num ) => ! B .has (num))
280281let C = new Set (c)
281282
282283console .log (C )
@@ -306,7 +307,7 @@ Map(0) {}
306307countries = [
307308 [' Finland' , ' Helsinki' ],
308309 [' Sweden' , ' Stockholm' ],
309- [' Norway' , ' Oslo' ]
310+ [' Norway' , ' Oslo' ],
310311]
311312const map = new Map (countries)
312313console .log (map)
@@ -347,7 +348,7 @@ Helsinki
347348
348349### Checking key in Map
349350
350- Check if a key exist in a map using * has * method. It returns * true * or * false * .
351+ Check if a key exist in a map using _ has _ method. It returns _ true _ or _ false _ .
351352
352353``` js
353354console .log (countriesMap .has (' Finland' ))
@@ -416,32 +417,35 @@ const countries = ['Finland', 'Sweden', 'Norway']
416417
417418 ``` js
418419 // Your output should look like this
419- console .log (mostSpokenLanguages (countries, 10 ))
420- [
421- { ' English ' : 91 },
422- { ' French ' : 45 },
423- { ' Arabic ' : 25 },
424- { ' Spanish ' : 24 },
425- { ' Russian ' : 9 },
426- { ' Portuguese ' : 9 },
427- { ' Dutch ' : 8 },
428- { ' German ' : 7 },
429- { ' Chinese ' : 5 },
430- { ' Swahili ' : 4 },
431- { ' Serbian ' : 4 } ]
420+ console .log (mostSpokenLanguages (countries, 10 ))[
421+ ({ English : 91 },
422+ { French : 45 },
423+ { Arabic : 25 },
424+ { Spanish : 24 },
425+ { Russian : 9 },
426+ { Portuguese : 9 },
427+ { Dutch : 8 },
428+ { German : 7 },
429+ { Chinese : 5 },
430+ { Swahili : 4 },
431+ { Serbian : 4 })
432+ ]
432433
433434 // Your output should look like this
434435 console .log (mostSpokenLanguages (countries, 3 ))
435-
436- [
437- {' English' : 91 },
438- {' French' : 45 },
439- {' Arabic' : 25 }
440- ]
441436 ```
442437
438+ [
439+ {'English':91},
440+ {'French':45},
441+ {'Arabic':25}
442+ ]
443+
444+ ```
445+
443446
444447🎉 CONGRATULATIONS ! 🎉
445448
446449
447450[<< 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)
451+ ```
0 commit comments