Skip to content

Commit fe61b12

Browse files
committed
day 25
1 parent a66a26b commit fe61b12

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

20_Day/20_day_writing_clean_code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const vegetables = ['Tomato', 'Potato', 'Cabbage', 'Onion', 'Carrot']
137137

138138
#### Functions
139139

140-
By now you are very familiar function declaration, expression function, arrow function and anonymous function. In this challenge we tend to use array function instead of other functions. Arrow function is not a replacement for other functions. In addition, arrow functions and function declarations are not exactly the same. So you should know when to use and when not. I will cover the difference in detail in other sections. We will use explicit return instead of implicit return if the function is one liner
140+
By now you are very familiar function declaration, expression function, arrow function and anonymous function. In this challenge we tend to use arrow function instead of other functions. Arrow function is not a replacement for other functions. In addition, arrow functions and function declarations are not exactly the same. So you should know when to use and when not. I will cover the difference in detail in other sections. We will use explicit return instead of implicit return if the function is one liner
141141

142142
```js
143143
// function which prints full name of a person
@@ -182,7 +182,7 @@ const showDateTime = () => {
182182

183183
#### Loops
184184

185-
We coverer many types of loops in this challenges. The regular fo loop, while loop, do while loop, for of loop, forEach loop and for in loop.
185+
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.
186186
Lets see how we use them:
187187

188188
```js

21_Day/21_day_dom.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ We can access already created element or elements using JavaScript. To access or
5959
<!DOCTYPE html>
6060
<html>
6161
<head>
62-
<title>Document Object Model/title>
62+
<title>Document Object Model</title>
6363
</head>
6464
<body>
6565

@@ -133,15 +133,15 @@ The _document.querySelector_ method can select an HTML or HTML elements by tag n
133133
**_querySelector_**: can be used to select HTML element by its tag name, id or class. If the tag name is used it selects only the first element.
134134

135135
```js
136-
let firstTitle = document.querySelect('h1') // select the first available h2 element
136+
let firstTitle = document.querySelector('h1') // select the first available h2 element
137137
let firstTitle = document.querySelector('#first-title') // select id with first-title
138138
let firstTitle = document.querySelector('.title') // select the first available h2 element with class title
139139
```
140140

141141
**_querySelectorAll_**: can be used to select html element by its tag name or class. It return a nodeList which is an array like object which support array methods. We can use **_for loop_** or **_forEach_** to loop through each nodeList elements.
142142

143143
```js
144-
const allTitles = document.querySelectAll('h1')
144+
const allTitles = document.querySelectorAll('h1')
145145

146146
console.log(allTitles.length) // 4
147147
for (let i = 0; i < allTitles.length; i++) {
@@ -299,7 +299,7 @@ Let us add some style to our titles. If the element has even index we give it gr
299299
```js
300300
const titles = document.querySelectorAll('h1')
301301
titles.forEach((title, i) => {
302-
title.fontSize = '24px' // all titles will have 24px font size
302+
title.style.fontSize = '24px' // all titles will have 24px font size
303303
if (i % 2 === 0) {
304304
title.style.color = 'green'
305305
} else {
@@ -315,7 +315,7 @@ Let us add some style to our titles. If the element has even index we give it gr
315315
```js
316316
const titles = document.querySelectorAll('h1')
317317
titles.forEach((title, i) => {
318-
title.fontSize = '24px' // all titles will have 24px font size
318+
title.style.fontSize = '24px' // all titles will have 24px font size
319319
if (i % 2 === 0) {
320320
title.style.backgroundColor = 'green'
321321
} else {
@@ -331,7 +331,7 @@ Let us add some style to our titles. If the element has even index we give it 20
331331
```js
332332
const titles = document.querySelectorAll('h1')
333333
titles.forEach((title, i) => {
334-
title.fontSize = '24px' // all titles will have 24px font size
334+
title.style.fontSize = '24px' // all titles will have 24px font size
335335
if (i % 2 === 0) {
336336
title.style.fontSize = '20px'
337337
} else {

22_Day/22_day_dom_day_2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ To see a created element on the HTML document we should append it to the parent
115115
title = document.createElement('h1')
116116
title.className = 'title'
117117
title.style.fontSize = '24px'
118+
title.textContent = i
118119
document.body.appendChild(title)
119120
}
120121
</script>
@@ -219,7 +220,7 @@ The above snippet of code cleared all the child elements.
219220

220221
### Exercises: Level 3
221222

222-
Check the requirement of this project from both images(jpg and gif). All the data and CSS has been implemented using JavaScript only. The data is found on starter folder project_3.
223+
Check the requirement of this project from both images(jpg and gif). All the data and CSS has been implemented using JavaScript only. The data is found on starter folder project_3. The drop down button has been created using [*details*](https://www.w3schools.com/tags/tag_details.asp) HTML element.
223224

224225
![Challenge Information](./../images/projects/dom_mini_project_challenge_info_day_2.3.gif)
225226

24_Day/24_day_dom_day_4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
</div>
1616

17-
[<< Day 23](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/23_Day/23_day_dom_day_3.md) | [Day 24 >>]()
17+
[<< Day 23](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/23_Day/23_day_dom_day_3.md) | [Day 25 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/25_Day/25_day_dom_day_5.md)
1818

1919
![Thirty Days Of JavaScript](../images/banners/day_1_24.png)
2020

@@ -34,4 +34,4 @@
3434

3535
🎉 CONGRATULATIONS ! 🎉
3636

37-
[<< Day 23](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/23_Day/23_day_dom_day_3.md) | [Day 24 >>]()
37+
[<< Day 23](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/23_Day/23_day_dom_day_3.md) | [Day 25 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/25_Day/25_day_dom_day_5.md)

0 commit comments

Comments
 (0)