From 585c33e7909b72bc72b55f0c9078ba70f4584bfa Mon Sep 17 00:00:00 2001 From: Asabeneh Date: Mon, 17 Aug 2020 15:32:42 +0300 Subject: [PATCH] fixes --- .../03_booleans_operators_date.md | 4 +- 10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md | 70 ++++++++++--------- .../11_day_destructuring_and_spreading.md | 4 +- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/03_Day_Booleans_operators_date/03_booleans_operators_date.md b/03_Day_Booleans_operators_date/03_booleans_operators_date.md index 399ec7d1..1b5298e0 100644 --- a/03_Day_Booleans_operators_date/03_booleans_operators_date.md +++ b/03_Day_Booleans_operators_date/03_booleans_operators_date.md @@ -272,7 +272,7 @@ console.log(count++) // 0 console.log(count) // 1 ``` -We use most of the time post-increment. At leas you should remember how to use post-increment operator. +We use most of the time post-increment. At least you should remember how to use post-increment operator. ### Decrement Operator @@ -571,7 +571,7 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56 1. Slope is (m = y2-y1/x2-x1). Find the slope between point (2, 2) and point(6,10) 1. Compare the slope of above two questions. 1. Calculate the value of y (y = x^2 + 6x + 9). Try to use different x values and figure out at what x value y is 0. -1. Writ a script that prompt a user to enters hours and rate per hour. Calculate pay of the person? +1. Writ a script that prompt a user to enter hours and rate per hour. Calculate pay of the person? ```sh Enter hours: 40 diff --git a/10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md b/10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md index a978a88e..295500ab 100644 --- a/10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md +++ b/10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md @@ -7,10 +7,11 @@ Twitter Follow - Author: - Asabeneh Yetayeh
- January, 2020 -
+Author: +Asabeneh Yetayeh
+ January, 2020 +
+ [<< 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 = [ 'French', 'Spanish', 'English', - 'French' + 'French', ] const setOfLangauges = new Set(languages) @@ -88,7 +89,7 @@ const languages = [ 'French', 'Spanish', 'English', - 'French' + 'French', ] const setOfLangauges = new Set(languages) @@ -183,7 +184,7 @@ const languages = [ 'French', 'Spanish', 'English', - 'French' + 'French', ] const langSet = new Set(languages) console.log(langSet) // Set(4) {"English", "Finnish", "French", "Spanish"} @@ -193,7 +194,7 @@ const counts = [] const count = {} for (const l of langSet) { - const filteredLang = languages.filter(lng => lng === l) + const filteredLang = languages.filter((lng) => lng === l) console.log(filteredLang) // ["English", "English", "English"] counts.push({ lang: l, count: filteredLang.length }) } @@ -201,11 +202,11 @@ console.log(counts) ``` ```js -[ +;[ { lang: 'English', count: 3 }, { lang: 'Finnish', count: 1 }, { lang: 'French', count: 2 }, - { lang: 'Spanish', count: 1 } + { lang: 'Spanish', count: 1 }, ] ``` @@ -254,7 +255,7 @@ let b = [3, 4, 5, 6] let A = new Set(a) let B = new Set(b) -let c = a.filter(num => B.has(num)) +let c = a.filter((num) => B.has(num)) let C = new Set(c) console.log(C) @@ -276,7 +277,7 @@ let b = [3, 4, 5, 6] let A = new Set(a) let B = new Set(b) -let c = a.filter(num => !B.has(num)) +let c = a.filter((num) => !B.has(num)) let C = new Set(c) console.log(C) @@ -306,7 +307,7 @@ Map(0) {} countries = [ ['Finland', 'Helsinki'], ['Sweden', 'Stockholm'], - ['Norway', 'Oslo'] + ['Norway', 'Oslo'], ] const map = new Map(countries) console.log(map) @@ -347,7 +348,7 @@ Helsinki ### Checking key in Map -Check if a key exist in a map using *has* method. It returns *true* or *false*. +Check if a key exist in a map using _has_ method. It returns _true_ or _false_. ```js console.log(countriesMap.has('Finland')) @@ -416,32 +417,35 @@ const countries = ['Finland', 'Sweden', 'Norway'] ```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}] + 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)) - - [ - {'English':91}, - {'French':45}, - {'Arabic':25} - ] ``` +[ +{'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) +``` diff --git a/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md b/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md index 075e9869..5f0e896c 100644 --- a/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md +++ b/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md @@ -57,7 +57,7 @@ Destructuring is a way to unpack arrays, and objects and assigning to a distinct ```js const names = ['Asabeneh', 'Brook', 'David', 'John'] - let [firstPerson, secondPerson, ThirdPerson, fourth Person] = names + let [firstPerson, secondPerson, thirdPerson, fourth Person] = names console.log(firstName, secondPerson,thirdPerson, fourthPerson) ``` @@ -108,7 +108,7 @@ If we like to skip on of the values in the array we use additional comma. The co ```js const names = ['Asabeneh', 'Brook', 'David', 'John'] - let [, secondPerson, , fourth Person] = name // first and third person is omitted + let [, secondPerson, , fourthPerson] = name // first and third person is omitted console.log(secondPerson, fourthPerson) ```