Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Aug 17, 2020
1 parent 8d0e1b0 commit 585c33e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
4 changes: 2 additions & 2 deletions 03_Day_Booleans_operators_date/03_booleans_operators_date.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
70 changes: 37 additions & 33 deletions 10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/asabeneh?style=social">
</a>

<sub>Author:
<a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br>
<small> January, 2020</small>
</sub>
<sub>Author:
<a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br>
<small> January, 2020</small>
</sub>

</div>

[<< 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)
Expand Down Expand Up @@ -67,7 +68,7 @@ const languages = [
'French',
'Spanish',
'English',
'French'
'French',
]

const setOfLangauges = new Set(languages)
Expand All @@ -88,7 +89,7 @@ const languages = [
'French',
'Spanish',
'English',
'French'
'French',
]

const setOfLangauges = new Set(languages)
Expand Down Expand Up @@ -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"}
Expand All @@ -193,19 +194,19 @@ 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 })
}
console.log(counts)
```

```js
[
;[
{ lang: 'English', count: 3 },
{ lang: 'Finnish', count: 1 },
{ lang: 'French', count: 2 },
{ lang: 'Spanish', count: 1 }
{ lang: 'Spanish', count: 1 },
]
```

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -306,7 +307,7 @@ Map(0) {}
countries = [
['Finland', 'Helsinki'],
['Sweden', 'Stockholm'],
['Norway', 'Oslo']
['Norway', 'Oslo'],
]
const map = new Map(countries)
console.log(map)
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -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)
```
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down Expand Up @@ -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)
```
Expand Down

0 comments on commit 585c33e

Please sign in to comment.