Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 02_Day_Data_types/02_day_data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ console.log(firstName.length) // 8

2. *Accessing characters in a string*: We can access each character in a string using its index. In programming, counting starts from 0. The first index of the string is zero, and the last index is the length of the string minus one.

![Accessing sting by index](../images/string_indexes.png)
![Accessing string by index](../images/string_indexes.png)

Let us access different characters in 'JavaScript' string.

Expand Down
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 @@ -556,7 +556,7 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56
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)
1. Write a script that prompt the user to enter side a, side b, and side c of the triangle and calculate the perimeter of triangle (perimeter = a + b + c)

```sh
Enter side a: 5
Expand Down Expand Up @@ -613,7 +613,7 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56
You are 15. You will be allowed to drive after 3 years.
```

1. Write a script that prompt the user to enter number of years. Calculate the number of seconds a person can live. Assume some one lives just hundred years
1. Write a script that prompt the user to enter number of years. Calculate the number of seconds a person can live. Assume someone lives just hundred years

```sh
Enter number of years you live: 100
Expand Down
4 changes: 2 additions & 2 deletions 04_Day_Conditionals/04_day_conditionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ isRaining
2 is an even number

Enter a number: 9
9 is is an odd number.
9 is an odd number.
```

### Exercises: Level 2

1. Write a code which can give grades to students according to theirs scores:
1. Write a code which can give grades to students according to their scores:
- 80-100, A
- 70-89, B
- 60-69, C
Expand Down
2 changes: 1 addition & 1 deletion 08_Day_Objects/08_day_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ console.log(copyPerson.hasOwnProperty('score'))
### Exercises: Level 1

1. Create an empty object called dog
1. Print the the dog object on the console
1. Print the dog object on the console
1. Add name, legs, color, age and bark properties for the dog object. The bark property is a method which return _woof woof_
1. Get name, legs, color, age and bark value from the dog object
1. Set new properties the dog object: breed, getDogInfo
Expand Down
6 changes: 3 additions & 3 deletions 10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Set(5) {5, 3, 2, 9, 4}

### Union of sets

To find a union to two sets can be achieved using spread operator. Lets find the union of set A and set B (A U B)
To find a union of two sets can be achieved using spread operator. Let's find the union of set A and set B (A U B)

```js
let a = [1, 2, 3, 4, 5]
Expand All @@ -242,7 +242,7 @@ Set(6) {1, 2, 3, 4, 5,6}

### Intersection of sets

To find an intersection of two sets can be achieved using filter. Lets find the intersection of set A and set B (A ∩ B)
To find an intersection of two sets can be achieved using filter. Let's find the intersection of set A and set B (A ∩ B)

```js
let a = [1, 2, 3, 4, 5]
Expand All @@ -263,7 +263,7 @@ Set(3) {3, 4, 5}

### Difference of sets

To find an the difference between two sets can be achieved using filter. Lets find the different of set A and set B (A \ B)
To find the difference between two sets can be achieved using filter. Let's find the difference of set A and set B (A \ B)

```js
let a = [1, 2, 3, 4, 5]
Expand Down
2 changes: 1 addition & 1 deletion 14_Day_Error_handling/13_day_console_object_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ReferenceError: fistName is not defined
at <anonymous>:4:20
In any case it will be executed
```
The catch block take a parameter. It is common to pass e, err or error as a parameter to the catch block. This parameter is an object and it has name and message keys. Lets use the name and message.
The catch block takes a parameter. It is common to pass e, err or error as a parameter to the catch block. This parameter is an object and it has name and message keys. Let's use the name and message.
```js
try {
let lastName = 'Yetayeh'
Expand Down
2 changes: 1 addition & 1 deletion 17_Day_Web_storages/17_day_web_storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Some use case of Web Storages are

For the examples mentioned above, it makes sense to use localStorage. You may be wondering, then, when we should use sessionStorage.

In cases, we want to to get rid of the data as soon as the window is closed. Or, perhaps, if we do not want the application to interfere with the same application that’s open in another window. These scenarios are served best with sessionStorage.
In cases, we want to get rid of the data as soon as the window is closed. Or, perhaps, if we do not want the application to interfere with the same application that’s open in another window. These scenarios are served best with sessionStorage.

Now, let us see how make use of these Web Storage APIs.

Expand Down
6 changes: 3 additions & 3 deletions 20_Day_Writing_clean_codes/20_day_writing_clean_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ const showDateTime = () => {
}
```

The `new Dat().toLocaleString()` can also be used to display current date time. The `toLocaleString()` methods takes different arguments. You may learn more about date and time from this [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString).
The `new Date().toLocaleString()` can also be used to display current date time. The `toLocaleString()` methods takes different arguments. You may learn more about date and time from this [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString).

#### Loops

We coverer many types of loops in this challenges. The regular for loop, while loop, do while loop, for of loop, forEach loop and for in loop.
Lets see how we use them:
We covered many types of loops in this challenge. The regular for loop, while loop, do while loop, for of loop, forEach loop and for in loop.
Let's see how we use them:

```js
for (let i = 0; i < n; i++){
Expand Down
4 changes: 2 additions & 2 deletions 21_Day_DOM/21_day_dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const allTitles = document.querySelectorAll('.title') // the same goes for selec

### Adding attribute

An attribute is added in the opening tag of HTML which gives additional information about the element. Common HTML attributes: id, class, src, style, href,disabled, title, alt. Lets add id and class for the fourth title.
An attribute is added in the opening tag of HTML which gives additional information about the element. Common HTML attributes: id, class, src, style, href, disabled, title, alt. Let's add id and class for the fourth title.

```js
const titles = document.querySelectorAll('h1')
Expand Down Expand Up @@ -351,7 +351,7 @@ As you have notice, the properties of css when we use it in JavaScript is going
### Exercise: Level 1

1. Create an index.html file and put four p elements as above: Get the first paragraph by using **_document.querySelector(tagname)_** and tag name
2. Get each of the the paragraph using **_document.querySelector('#id')_** and by their id
2. Get each of the paragraphs using **_document.querySelector('#id')_** and by their id
3. Get all the p as nodeList using **_document.querySelectorAll(tagname)_** and by their tag name
4. Loop through the nodeList and get the text content of each paragraph
5. Set a text content to paragraph the fourth paragraph,**_Fourth Paragraph_**
Expand Down