Skip to content

Commit ff64df9

Browse files
committed
minor changes
1 parent c205c28 commit ff64df9

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

04_Day_Conditionals/04_day_conditionals.md

+28-25
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
- [📔 Day 4](#-day-4)
2121
- [Conditionals](#conditionals)
22-
- [if](#if)
23-
- [if else](#if-else)
24-
- [if else if else](#if-else-if-else)
22+
- [If](#if)
23+
- [If Else](#if-else)
24+
- [If Else if Else](#if-else-if-else)
2525
- [Switch](#switch)
2626
- [Ternary Operators](#ternary-operators)
2727
- [💻 Exercises](#-exercises)
@@ -33,11 +33,11 @@
3333

3434
## Conditionals
3535

36-
Conditional statements are used to make decisions based on different conditions.
36+
Conditional statements are used for make decisions based on different conditions.
3737
By default , statements in JavaScript script executed sequentially from top to bottom. If the processing logic require so, the sequential flow of execution can be altered in two ways:
3838

3939
- Conditional execution: a block of one or more statements will be executed if a certain expression is true
40-
- Repetitive execution: a block of one or more statements will be repetitively executed as long as a certain expression is true. In this section, we will cover _if_, _else_ , _else if_ statements. The comparison and logical operator we learned in the previous sections will be useful in here.
40+
- Repetitive execution: a block of one or more statements will be repetitively executed as long as a certain expression is true. In this section, we will cover _if_, _else_ , _else if_ statements. The comparison and logical operators we learned in the previous sections will be useful in here.
4141

4242
Conditions can be implementing using the following ways:
4343

@@ -47,14 +47,14 @@ Conditions can be implementing using the following ways:
4747
- switch
4848
- ternary operator
4949

50-
### if
50+
### If
5151

52-
In JavaScript and other programming languages the key word _if_ is used to check if a condition is true and to execute the block code. To create an if condition, we need _if_ keyword, condition inside a parenthesis and block of code inside a curly bracket({}).
52+
In JavaScript and other programming languages the key word _if_ is to used check if a condition is true and to execute the block code. To create an if condition, we need _if_ keyword, condition inside a parenthesis and block of code inside a curly bracket({}).
5353

5454
```js
5555
// syntax
5656
if (condition) {
57-
//this part of code run for truthy condition
57+
//this part of code runs for truthy condition
5858
}
5959
```
6060

@@ -68,7 +68,7 @@ if (num > 0) {
6868
// 3 is a positive number
6969
```
7070

71-
As you can see in the above condition, 3 is greater than 0 and it is a positive number. The condition was true and the block code was executed. However, if the condition is false, we do not see a result.
71+
As you can see in the condition example above, 3 is greater than 0, so it is a positive number. The condition was true and the block of code was executed. However, if the condition is false, we won't see any results.
7272

7373
```js
7474
let isRaining = true
@@ -77,18 +77,18 @@ if (isRaining) {
7777
}
7878
```
7979

80-
The same goes for the second condition, if isRaining is false the if block will not be executed and we do not see an output. In order to see the result of the falsy condition, we should have another block, which is going to be _else_.
80+
The same goes for the second condition, if isRaining is false the if block will not be executed and we do not see any output. In order to see the result of a falsy condition, we should have another block, which is going to be _else_.
8181

82-
### if else
82+
### If Else
8383

8484
If condition is true the first block will be executed, if not the else condition will be executed.
8585

8686
```js
8787
// syntax
8888
if (condition) {
89-
// this part of code run for truthy condition
89+
// this part of code runs for truthy condition
9090
} else {
91-
// this part of code run for false condition
91+
// this part of code runs for false condition
9292
}
9393
```
9494

@@ -128,11 +128,11 @@ if (isRaining) {
128128
// No need for a rain coat.
129129
```
130130

131-
The above condition is false, therefore the else block was executed. How about if our condition is more than two, we will use *else if* conditions.
131+
The last condition is false, therefore the else block was executed. What if we have more than two conditions? In that case, we would use *else if* conditions.
132132

133-
### if else if else
133+
### If Else if Else
134134

135-
On our daily life, we make decision on daily basis. We make decision not by checking one or two conditions instead we make decisions based on multiple conditions. As similar to our daily life, programming is also full of conditions. We use *else if* when we have multiple conditions.
135+
On our daily life, we make decisions on daily basis. We make decisions not by checking one or two conditions instead we make decisions based on multiple conditions. As similar to our daily life, programming is also full of conditions. We use *else if* when we have multiple conditions.
136136

137137
```js
138138
// syntax
@@ -178,7 +178,7 @@ if (weather === 'rainy') {
178178
### Switch
179179

180180
Switch is an alternative for **if else if else else**.
181-
The switch statement starts with a switch keyword followed by a parenthesis and code block. Inside the code block we will have different cases. Case block run if the value in the switch statement parenthesis match with the case vale. The break is to terminate and it does not go down after the condition is satisfied. The default block run if all the cases don't satisfy the condition.
181+
The switch statement starts with a *switch* keyword followed by a parenthesis and code block. Inside the code block we will have different cases. Case block runs if the value in the switch statement parenthesis matches with the case value. The break statement is to terminate execution so the code execution does not go down after the condition is satisfied. The default block runs if all the cases don't satisfy the condition.
182182

183183
```js
184184
switch(caseValue){
@@ -264,7 +264,7 @@ switch (true) {
264264

265265
### Ternary Operators
266266

267-
Another way to write conditionals is using ternary operators. We have covered this in other sections but we should also mention it here.
267+
Another way to write conditionals is using ternary operators. We have covered this in other sections, but we should also mention it here.
268268

269269
```js
270270
let isRaining = true
@@ -273,13 +273,13 @@ isRaining
273273
: console.log('No need for a rain coat.')
274274
```
275275

276-
🌕 You are extraordinary and you have a remarkable potential. You have just completed day 4 challenges and you are four steps a head in to your way to greatness. Now do some exercises for your brain and for your muscle.
276+
🌕 You are extraordinary and you have a remarkable potential. You have just completed day 4 challenges and you are four steps ahead to your way to greatness. Now do some exercises for your brain and muscle.
277277

278278
## 💻 Exercises
279279

280280
### Exercises: Level 1
281281

282-
1. Get user input using prompt(“Enter your age:”). If user is 18 or older , give feedback:You are old enough to drive but if not 18 give feedback to wait for the years he supposed to wait for.
282+
1. Get user input using prompt(“Enter your age:”). If user is 18 or older , give feedback:'You are old enough to drive' but if not 18 give another feedback stating to wait for the number of years he neds to turn 18.
283283

284284
```sh
285285
Enter your age: 30
@@ -289,14 +289,14 @@ isRaining
289289
You are left with 3 years to drive.
290290
```
291291

292-
1. Compare the values of myAge and yourAge using if … else. Based on the comparison log to console who is older (me or you). Use prompt(“Enter your age:”) to get the age as input.
292+
1. Compare the values of myAge and yourAge using if … else. Based on the comparison and log the result to console stating who is older (me or you). Use prompt(“Enter your age:”) to get the age as input.
293293

294294
```sh
295295
Enter your age: 30
296296
You are 5 years older than me.
297297
```
298298

299-
1. If a is greater than b return 'a is greater than b' else 'a is less than b'. Try to implement in to ways
299+
1. If a is greater than b return 'a is greater than b' else 'a is less than b'. Try to implement it in to ways
300300

301301
- using if else
302302
- ternary operator.
@@ -310,7 +310,7 @@ isRaining
310310
4 is greater than 3
311311
```
312312

313-
1. Even numbers are divisible by 2 and the remainder is zero. How do you check if a number is even or not using JavaScript?
313+
1. Even numbers are divisible by 2 and the remainder is zero. How do you check, if a number is even or not using JavaScript?
314314

315315
```sh
316316
Enter a number: 2
@@ -322,14 +322,14 @@ isRaining
322322

323323
### Exercises: Level 2
324324

325-
1. Write a code which can give grade to students according to theirs scores:
325+
1. Write a code which can give grades to students according to theirs scores:
326326
- 80-100, A
327327
- 70-89, B
328328
- 60-69, C
329329
- 50-59, D
330330
- 0-49, F
331331
1. Check if the season is Autumn, Winter, Spring or Summer.
332-
If the user input is:
332+
If the user input is :
333333
- September, October or November, the season is Autumn.
334334
- December, January or February, the season is Winter.
335335
- March, April or May, the season is Spring
@@ -368,6 +368,9 @@ isRaining
368368
February has 28 days.
369369
```
370370

371+
1. Write a program which tells the number of days in a month, now consider leap year.
372+
373+
371374
🎉 CONGRATULATIONS ! 🎉
372375

373376
[<< Day 3](../03_Day_Booleans_operators_date/03_booleans_operators_date.md) | [Day 5 >>](../05_Day_Arrays/05_day_arrays.md)

10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
## Set
4646

47-
Set is a collection a collection of elements. Set can only contains unique elements.
47+
Set is a collection of elements. Set can only contains unique elements.
4848
Lets see how to create a set
4949

5050
### Creating an empty set

readMe.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
![Thirty Days Of JavaScript](./images/day_1_1.png)
7373

7474
- [30 Days Of JavaScript](#30-days-of-javascript)
75-
- [📔Day 1](#day-1)
75+
- [📔 Day 1](#-day-1)
7676
- [Introduction](#introduction)
7777
- [Requirements](#requirements)
7878
- [Setup](#setup)
@@ -105,13 +105,13 @@
105105
- [Variables](#variables)
106106
- [💻 Day 1: Exercises](#-day-1-exercises)
107107

108-
# 📔Day 1
108+
# 📔 Day 1
109109

110110
## Introduction
111111

112112
**Congratulations** on deciding to participate in 30 days of JavaScript programming challenge. In this challenge you will learn everything you need to be a JavaScript programmer, and in general, the whole concept of programming. In the end of the challenge you will get a 30DaysOfJavaScript programming challenge completion certificate. In case you need help or if you would like to help others you may join the [telegram group](https://t.me/ThirtyDaysOfJavaScript).
113113

114-
**A 30DaysOfJavaScript** challenge is a guide for both beginners and advanced JavaScript developers. Welcome to JavaScript.JavaScript is the language of the web. I enjoy using and teaching JavaScript and I hope you will do so too.
114+
**A 30DaysOfJavaScript** challenge is a guide for both beginners and advanced JavaScript developers. Welcome to JavaScript. JavaScript is the language of the web. I enjoy using and teaching JavaScript and I hope you will do so too.
115115

116116
In this step by step JavaScript challenge, you will learn JavaScript, the most popular programming language in the history of mankind.
117117
JavaScript is used **_to add interactivity to websites, to develop mobile apps, desktop applications, games_** and nowadays JavaScript can be used for **_machine learning_** and **_AI_**.

0 commit comments

Comments
 (0)