Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Nov 17, 2021
1 parent 07143be commit b094b3f
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 45 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 @@ -382,7 +382,7 @@ These are not all the window methods we will have a separate section to go deep
## Date Object

Time is an important thing. We like to know the time a certain activity or event. In JavaScript current time and date is created using JavaScript Date Object. The object we create using Date object provides many methods to work with date and time.The methods we use to get date and time information from a date object values are started with a word _get_ because it provide the information.
_getFullYear(), getMonths(), getDate(), getDay(), getHours(), getMinutes, getSeconds(), getMilliseconds(), getTime(), getDay()_
_getFullYear(), getMonth(), getDate(), getDay(), getHours(), getMinutes, getSeconds(), getMilliseconds(), getTime(), getDay()_

![Date time Object](../images/date_time_object.png)

Expand Down Expand Up @@ -553,7 +553,7 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56
```sh
Enter base: 20
Enter height: 10
The area of the triangle is 50
The area of the triangle is 100
```

1. Write a script that prompt the user to enter side a, side b, and side c of the triangle and and calculate the perimeter of triangle (perimeter = a + b + c)
Expand Down
2 changes: 1 addition & 1 deletion 05_Day_Arrays/05_day_arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</sub>
</div>

[<< Day 4](../04_Day_Conditionals/04_day_Conditionals.md) | [Day 6 >>](../06_Day_Loops/06_day_loops.md)
[<< Day 4](../04_Day_Conditionals/04_day_conditionals.md) | [Day 6 >>](../06_Day_Loops/06_day_loops.md)

![Day 5](../images/banners/day_1_5.png)

Expand Down
2 changes: 1 addition & 1 deletion 06_Day_Loops/06_day_loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ for (const num of numbers) {
// adding all the numbers in the array
let sum = 0
for (const num of numbers) {
sum += sum + num // can be also shorten like this, sum += num
sum = sum + num // can be also shorten like this, sum += num
}
console.log(sum) // 15

Expand Down
34 changes: 14 additions & 20 deletions 10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ console.log(C)

```sh
Set(6) {1, 2, 3, 4, 5,6}

```

### Intersection of sets
Expand All @@ -263,7 +262,6 @@ console.log(C)

```sh
Set(3) {3, 4, 5}

```

### Difference of sets
Expand All @@ -285,7 +283,6 @@ console.log(C)

```sh
Set(2) {1, 2}

```

## Map
Expand Down Expand Up @@ -372,7 +369,7 @@ for (const country of countriesMap) {
(2) ["Norway", "Oslo"]
```

```sh
```js
for (const [country, city] of countriesMap){
console.log(country, city)
}
Expand Down Expand Up @@ -415,10 +412,11 @@ const countries = ['Finland', 'Sweden', 'Norway']

1. \*\*\* Use the countries data to find the 10 most spoken languages:

```js
```js
// Your output should look like this
console.log(mostSpokenLanguages(countries, 10))[
({ English: 91 },
console.log(mostSpokenLanguages(countries, 10))
[
{ English: 91 },
{ French: 45 },
{ Arabic: 25 },
{ Spanish: 24 },
Expand All @@ -428,24 +426,20 @@ const countries = ['Finland', 'Sweden', 'Norway']
{ German: 7 },
{ Chinese: 5 },
{ Swahili: 4 },
{ Serbian: 4 })
{ Serbian: 4 }
]

// Your output should look like this
console.log(mostSpokenLanguages(countries, 3))
```

[
{'English':91},
{'French':45},
{'Arabic':25}
]

// 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)
```
[<< 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,9 +57,9 @@ 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, fourthPerson] = names

console.log(firstName, secondPerson,thirdPerson, fourthPerson)
console.log(firstPerson, secondPerson,thirdPerson, fourthPerson)
```

```sh
Expand Down
7 changes: 4 additions & 3 deletions 18_Day_Promises/18_day_promises.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ doPromise
The Fetch API provides an interface for fetching resources (including across the network). It will seem familiar to anyone who has used XMLHttpRequest, but the new API provides a more powerful and flexible feature set. In this challenge we will use fetch to request url and APIS. In addition to that let us see demonstrate use case of promises in accessing network resources using the fetch API.

```js
const url = 'https://restcountries.eu/rest/v2/all' // countries api

const url = 'https://restcountries.com/v2/all' // countries api
fetch(url)
.then(response => response.json()) // accessing the API data as JSON
.then(data => { // getting the data
Expand Down Expand Up @@ -219,7 +220,7 @@ Let us fetch API data using both promise method and async and await method.
- promise

```js
const url = 'https://restcountries.eu/rest/v2/all'
const url = 'https://restcountries.com/v2/all'
fetch(url)
.then(response => response.json())
.then(data => {
Expand Down Expand Up @@ -249,7 +250,7 @@ fetchData()
## Exercises

```js
const countriesAPI = 'https://restcountries.eu/rest/v2/all'
const countriesAPI = 'https://restcountries.com/v2/all'
const catsAPI = 'https://api.thecatapi.com/v1/breeds'
```

Expand Down
2 changes: 1 addition & 1 deletion 21_Day_DOM/21_day_dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const titles = document.querySelectorAll('h1')
titles[3].textContent = 'Fourth Title'
```

#### Adding Text Content using innHTML
#### Adding Text Content using innerHTML

Most people get confused between _textContent_ and _innerHTML_. _textContent_ is meant to add text to an HTML element, however innerHTML can add a text or HTML element or elements as a child.

Expand Down
29 changes: 14 additions & 15 deletions readMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ console.log('Hello, World!')

##### Console.log with Multiple Arguments

The **conole.log()** function can take multiple parameters separated by comma. The syntax looks like as follows:**console.log(param1, param2, param3)**
The **console.log()** function can take multiple parameters separated by comma. The syntax looks like as follows:**console.log(param1, param2, param3)**

![console log multiple arguments](./images/console_log_multipl_arguments.png)

Expand All @@ -231,11 +231,11 @@ We add comments to our code. Comments are very important to make code more reada

**Example: Multiline Comment**

/_
/*
This is a multiline comment
Multiline comments can take multiple lines
JavaScript is the language of the web
_/
*/

##### Syntax

Expand Down Expand Up @@ -527,18 +527,18 @@ Multiline commenting:

```js
/*
let location = 'Helsinki';
let age = 100;
let isMarried = true;
This is a Multiple line comment
*/
let location = 'Helsinki';
let age = 100;
let isMarried = true;
This is a Multiple line comment
*/
```

## Variables

Variables are _containers_ of data. Variables are used to _store_ data in a memory location. When a variable is declared, a memory location is reserved. When a variable is assigned to a value (data), the memory space will be filled with that data. To declare a variable, we use _var_, _let_, or _const_ keywords.

For a variable that changes at a different time, we use _let_. If the data does not change at all, we use _const_. For example, PI, country name, gravity do no change, and we can use _const_. We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.
For a variable that changes at a different time, we use _let_. If the data does not change at all, we use _const_. For example, PI, country name, gravity do not change, and we can use _const_. We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.

A valid JavaScript variable name must follow the following rules:

Expand Down Expand Up @@ -571,7 +571,7 @@ year2020
year_2020
```

The first and second variables on the list follows the camelCase convention of declaring in JavaScrip. In this material, we will use camelCase variables.
The first and second variables on the list follows the camelCase convention of declaring in JavaScript. In this material, we will use camelCase variables.

Example of invalid variables:

Expand Down Expand Up @@ -603,16 +603,15 @@ console.log(firstName, lastName, country, city, age, isMarried)
```

```sh
Asabeneh Yetayeh Finland Helsinki 100 True
Asabeneh Yetayeh Finland Helsinki 100 true
```

```js
// Declaring variables with number values
let age = 100 // age in years
const gravity = 9.81 // earth gravity in m/s2
const boilingPoint = 100 // water boiling point, temperature in oC
const boilingPoint = 100 // water boiling point, temperature in °C
const PI = 3.14 // geometrical constant

console.log(gravity, boilingPoint, PI)
```

Expand All @@ -623,8 +622,8 @@ console.log(gravity, boilingPoint, PI)
```js
// Variables can also be declaring in one line separated by comma
let name = 'Asabeneh', // name of a person
job = 'teacher',
live = 'Finland'
job = 'teacher',
live = 'Finland'
console.log(name, job, live)
```

Expand Down

0 comments on commit b094b3f

Please sign in to comment.