Skip to content

Commit 838efcb

Browse files
authored
Merge pull request #1 from Asabeneh/master
New pull request
2 parents ff64df9 + 55d8e3d commit 838efcb

File tree

436 files changed

+96607
-5155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

436 files changed

+96607
-5155
lines changed

Diff for: 01_Day_Introduction/01_day_starter/index.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
5-
<title>30DaysOfJavaScript</title>
5+
<title>30DaysOfJavaScript</title>
66
</head>
77

88
<body>
9-
<h1>30DaysOfJavaScript:03 Day</h1>
10-
<h2>Introduction</h2>
11-
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
12-
<script src="./helloworld.js"></script>
13-
<script src="./introduction.js"></script>
14-
<script src="./varaible.js"></script>
15-
<script src="./main.js"></script>
9+
<h1>30DaysOfJavaScript:03 Day</h1>
10+
<h2>Introduction</h2>
11+
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
12+
<script src="./helloworld.js"></script>
13+
<script src="./introduction.js"></script>
14+
<script src="./variable.js"></script>
15+
<script src="./main.js"></script>
1616

1717
</body>
1818

Diff for: 02_Day_Data_types/02_day_data_types.md

+31-27
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@
1919
![Thirty Days Of JavaScript](../images/banners/day_1_2.png)
2020

2121
- [📔 Day 2](#-day-2)
22-
- [Data Types](#data-types)
23-
- [Primitive Data Types](#primitive-data-types)
24-
- [Non-Primitive Data Types](#non-primitive-data-types)
25-
- [Numbers](#numbers)
26-
- [Declaring Number Data Types](#declaring-number-data-types)
27-
- [Math Object](#math-object)
28-
- [Random Number Generator](#random-number-generator)
29-
- [Strings](#strings)
30-
- [String Concatenation](#string-concatenation)
31-
- [Concatenating Using Addition Operator](#concatenating-using-addition-operator)
32-
- [Long Literal Strings](#long-literal-strings)
33-
- [Escape Sequences in Strings](#escape-sequences-in-strings)
34-
- [Template Literals (Template Strings)](#template-literals-template-strings)
35-
- [String Methods](#string-methods)
36-
- [Checking Data Types and Casting](#checking-data-types-and-casting)
37-
- [Checking Data Types](#checking-data-types)
38-
- [Changing Data Type (Casting)](#changing-data-type-casting)
39-
- [String to Int](#string-to-int)
40-
- [String to Float](#string-to-float)
41-
- [Float to Int](#float-to-int)
42-
- [💻 Day 2: Exercises](#-day-2-exercises)
43-
- [Exercise: Level 1](#exercise-level-1)
44-
- [Exercise: Level 2](#exercise-level-2)
45-
- [Exercises: Level 3](#exercises-level-3)
22+
- [Data Types](#data-types)
23+
- [Primitive Data Types](#primitive-data-types)
24+
- [Non-Primitive Data Types](#non-primitive-data-types)
25+
- [Numbers](#numbers)
26+
- [Declaring Number Data Types](#declaring-number-data-types)
27+
- [Math Object](#math-object)
28+
- [Random Number Generator](#random-number-generator)
29+
- [Strings](#strings)
30+
- [String Concatenation](#string-concatenation)
31+
- [Concatenating Using Addition Operator](#concatenating-using-addition-operator)
32+
- [Long Literal Strings](#long-literal-strings)
33+
- [Escape Sequences in Strings](#escape-sequences-in-strings)
34+
- [Template Literals (Template Strings)](#template-literals-template-strings)
35+
- [String Methods](#string-methods)
36+
- [Checking Data Types and Casting](#checking-data-types-and-casting)
37+
- [Checking Data Types](#checking-data-types)
38+
- [Changing Data Type (Casting)](#changing-data-type-casting)
39+
- [String to Int](#string-to-int)
40+
- [String to Float](#string-to-float)
41+
- [Float to Int](#float-to-int)
42+
- [💻 Day 2: Exercises](#-day-2-exercises)
43+
- [Exercise: Level 1](#exercise-level-1)
44+
- [Exercise: Level 2](#exercise-level-2)
45+
- [Exercises: Level 3](#exercises-level-3)
4646

4747
# 📔 Day 2
4848

@@ -62,12 +62,12 @@ Primitive data types in JavaScript include:
6262
3. Booleans - true or false value
6363
4. Null - empty value or no value
6464
5. Undefined - a declared variable without a value
65+
6. Symbol - A unique value that can be generated by Symbol constructor
6566

6667
Non-primitive data types in JavaScript includes:
6768

6869
1. Objects
69-
2. Functions
70-
3. Arrays
70+
2. Arrays
7171

7272
Now, let us see what exactly primitive and non-primitive data types mean.
7373
*Primitive* data types are immutable(non-modifiable) data types. Once a primitive data type is created we cannot modify it.
@@ -231,6 +231,10 @@ console.log(Math.E) // 2.718
231231
console.log(Math.log(2)) // 0.6931471805599453
232232
console.log(Math.log(10)) // 2.302585092994046
233233

234+
// Returns the natural logarithm of 2 and 10 respectively
235+
console.log(Math.LN2) // 0.6931471805599453
236+
console.log(Math.LN10) // 2.302585092994046
237+
234238
// Trigonometry
235239
Math.sin(0)
236240
Math.sin(60)
@@ -876,7 +880,7 @@ console.log(numFloat) // 9.81
876880
let num = '9.81'
877881
let numFloat = +num
878882
879-
console.log(numInt) // 9.81
883+
console.log(numFloat) // 9.81
880884
```
881885
882886
#### Float to Int

Diff for: 02_Day_Data_types/02_day_starter/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<title>30DaysOfJavaScript</title>

Diff for: 02_Day_Data_types/string_methods/match.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let pattern = /love/gi
1414
console.log(string.match(pattern)) // ["love", "love", "love"]
1515
// Let us extract numbers from text using regular expression. This is not regular expression section, no panic.
1616

17-
let txt = 'In 2019, I run 30 Days of Pyhton. Now, in 2020 I super exited to start this challenge'
17+
let txt = 'In 2019, I run 30 Days of Python. Now, in 2020 I super exited to start this challenge'
1818
let regEx = /\d/g // d with escape character means d not a normal d instead acts a digit
1919
// + means one or more digit numbers,
2020
// if there is g after that it means global, search everywhere.

Diff for: 02_Day_Data_types/string_methods/split.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// split(): The split method splits a string at a specified place.
2-
let string = '30 Days Of JavaScipt'
2+
let string = '30 Days Of JavaScript'
33
console.log(string.split()) // ["30 Days Of JavaScript"]
44
console.log(string.split(' ')) // ["30", "Days", "Of", "JavaScript"]
55
let firstName = 'Asabeneh'

Diff for: 03_Day_Booleans_operators_date/03_booleans_operators_date.md

+43-43
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,38 @@
1818
![Thirty Days Of JavaScript](../images/banners/day_1_3.png)
1919

2020
- [📔 Day 3](#-day-3)
21-
- [Booleans](#booleans)
22-
- [Truthy values](#truthy-values)
23-
- [Falsy values](#falsy-values)
24-
- [Undefined](#undefined)
25-
- [Null](#null)
26-
- [Operators](#operators)
27-
- [Assignment operators](#assignment-operators)
28-
- [Arithmetic Operators](#arithmetic-operators)
29-
- [Comparison Operators](#comparison-operators)
30-
- [Logical Operators](#logical-operators)
31-
- [Increment Operator](#increment-operator)
32-
- [Decrement Operator](#decrement-operator)
33-
- [Ternary Operators](#ternary-operators)
34-
- [Operator Precendence](#operator-precendence)
35-
- [Window Methods](#window-methods)
36-
- [Window alert() method](#window-alert-method)
37-
- [Window prompt() method](#window-prompt-method)
38-
- [Window confirm() method](#window-confirm-method)
39-
- [Date Object](#date-object)
40-
- [Creating a time object](#creating-a-time-object)
41-
- [Getting full year](#getting-full-year)
42-
- [Getting month](#getting-month)
43-
- [Getting date](#getting-date)
44-
- [Getting day](#getting-day)
45-
- [Getting hours](#getting-hours)
46-
- [Getting minutes](#getting-minutes)
47-
- [Getting seconds](#getting-seconds)
48-
- [Getting time](#getting-time)
49-
- [💻 Day 3: Exercises](#-day-3-exercises)
50-
- [Exercises: Level 1](#exercises-level-1)
51-
- [Exercises: Level 2](#exercises-level-2)
52-
- [Exercises: Level 3](#exercises-level-3)
21+
- [Booleans](#booleans)
22+
- [Truthy values](#truthy-values)
23+
- [Falsy values](#falsy-values)
24+
- [Undefined](#undefined)
25+
- [Null](#null)
26+
- [Operators](#operators)
27+
- [Assignment operators](#assignment-operators)
28+
- [Arithmetic Operators](#arithmetic-operators)
29+
- [Comparison Operators](#comparison-operators)
30+
- [Logical Operators](#logical-operators)
31+
- [Increment Operator](#increment-operator)
32+
- [Decrement Operator](#decrement-operator)
33+
- [Ternary Operators](#ternary-operators)
34+
- [Operator Precedence](#operator-precedence)
35+
- [Window Methods](#window-methods)
36+
- [Window alert() method](#window-alert-method)
37+
- [Window prompt() method](#window-prompt-method)
38+
- [Window confirm() method](#window-confirm-method)
39+
- [Date Object](#date-object)
40+
- [Creating a time object](#creating-a-time-object)
41+
- [Getting full year](#getting-full-year)
42+
- [Getting month](#getting-month)
43+
- [Getting date](#getting-date)
44+
- [Getting day](#getting-day)
45+
- [Getting hours](#getting-hours)
46+
- [Getting minutes](#getting-minutes)
47+
- [Getting seconds](#getting-seconds)
48+
- [Getting time](#getting-time)
49+
- [💻 Day 3: Exercises](#-day-3-exercises)
50+
- [Exercises: Level 1](#exercises-level-1)
51+
- [Exercises: Level 2](#exercises-level-2)
52+
- [Exercises: Level 3](#exercises-level-3)
5353

5454
# 📔 Day 3
5555

@@ -73,7 +73,7 @@ We agreed that boolean values are either true or false.
7373
### Truthy values
7474

7575
- All numbers(positive and negative) are truthy except zero
76-
- All strings are truthy
76+
- All strings are truthy except an empty string ('')
7777
- The boolean true
7878

7979
### Falsy values
@@ -218,7 +218,7 @@ console.log('python'.length > 'dragon'.length) // false
218218
```
219219

220220
Try to understand the above comparisons with some logic. Remembering without any logic might be difficult.
221-
JavaScript is some how a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result.
221+
JavaScript is somehow a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result.
222222

223223
As rule of thumb, if a value is not true with == it will not be equal with ===. Using === is safer than using ==. The following [link](https://dorey.github.io/JavaScript-Equality-Table/) has an exhaustive list of comparison of data types.
224224

@@ -254,7 +254,7 @@ let isMarried = !false // true
254254

255255
### Increment Operator
256256

257-
In JavaScrip we use the increment operator to increase a value stored in a variable. The increment could be pre or post increment. Let us see each of them:
257+
In JavaScript we use the increment operator to increase a value stored in a variable. The increment could be pre or post increment. Let us see each of them:
258258

259259
1. Pre-increment
260260

@@ -276,7 +276,7 @@ We use most of the time post-increment. At least you should remember how to use
276276

277277
### Decrement Operator
278278

279-
In JavaScrip we use the decrement operator to decrease a value stored in a variable. The decrement could be pre or post decrement. Let us see each of them:
279+
In JavaScript we use the decrement operator to decrease a value stored in a variable. The decrement could be pre or post decrement. Let us see each of them:
280280

281281
1. Pre-decrement
282282

@@ -333,9 +333,9 @@ number > 0
333333
-5 is a negative number
334334
```
335335

336-
### Operator Precendence
336+
### Operator Precedence
337337

338-
I would like to recommend you to read about operator precendence from this [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
338+
I would like to recommend you to read about operator precedence from this [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
339339

340340
## Window Methods
341341

@@ -382,7 +382,7 @@ These are not all the window methods we will have a separate section to go deep
382382
## Date Object
383383

384384
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.
385-
_getFullYear(), getMonths(), getDate(), getDay(), getHours(), getMinutes, getSeconds(), getMilliseconds(), getTime(), getDay()_
385+
_getFullYear(), getMonth(), getDate(), getDay(), getHours(), getMinutes, getSeconds(), getMilliseconds(), getTime(), getDay()_
386386

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

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

559559
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)
@@ -568,9 +568,9 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56
568568
1. Get length and width using prompt and calculate an area of rectangle (area = length x width and the perimeter of rectangle (perimeter = 2 x (length + width))
569569
1. Get radius using prompt and calculate the area of a circle (area = pi x r x r) and circumference of a circle(c = 2 x pi x r) where pi = 3.14.
570570
1. Calculate the slope, x-intercept and y-intercept of y = 2x -2
571-
1. Slope is (m = y2-y1/x2-x1). Find the slope between point (2, 2) and point(6,10)
571+
1. Slope is m = (y<sub>2</sub>-y<sub>1</sub>)/(x<sub>2</sub>-x<sub>1</sub>). Find the slope between point (2, 2) and point(6,10)
572572
1. Compare the slope of above two questions.
573-
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.
573+
1. Calculate the value of y (y = x<sup>2</sup> + 6x + 9). Try to use different x values and figure out at what x value y is 0.
574574
1. Writ a script that prompt a user to enter hours and rate per hour. Calculate pay of the person?
575575

576576
```sh
@@ -616,7 +616,7 @@ console.log(`${date}/${month}/${year} ${hours}:${minutes}`) // 4/1/2020 0:56
616616
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
617617

618618
```sh
619-
Enter number of yours you live: 100
619+
Enter number of years you live: 100
620620
You lived 3153600000 seconds.
621621
```
622622

Diff for: 03_Day_Booleans_operators_date/03_day_starter/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<title>30DaysOfJavaScript: 03 Day</title>

Diff for: 04_Day_Conditionals/04_day_conditionals.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
![Thirty Days Of JavaScript](../images/banners/day_1_4.png)
1919

2020
- [📔 Day 4](#-day-4)
21-
- [Conditionals](#conditionals)
22-
- [If](#if)
23-
- [If Else](#if-else)
24-
- [If Else if Else](#if-else-if-else)
25-
- [Switch](#switch)
26-
- [Ternary Operators](#ternary-operators)
27-
- [💻 Exercises](#-exercises)
28-
- [Exercises: Level 1](#exercises-level-1)
29-
- [Exercises: Level 2](#exercises-level-2)
30-
- [Exercises: Level 3](#exercises-level-3)
21+
- [Conditionals](#conditionals)
22+
- [If](#if)
23+
- [If Else](#if-else)
24+
- [If Else if Else](#if--else-if-else)
25+
- [Switch](#switch)
26+
- [Ternary Operators](#ternary-operators)
27+
- [💻 Exercises](#-exercises)
28+
- [Exercises: Level 1](#exercises-level-1)
29+
- [Exercises: Level 2](#exercises-level-2)
30+
- [Exercises: Level 3](#exercises-level-3)
3131

3232
# 📔 Day 4
3333

@@ -189,7 +189,8 @@ switch(caseValue){
189189
// code
190190
break
191191
case 3:
192-
// code
192+
// code
193+
break
193194
default:
194195
// code
195196
}
@@ -279,7 +280,7 @@ isRaining
279280

280281
### Exercises: Level 1
281282

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.
283+
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 needs to turn 18.
283284

284285
```sh
285286
Enter your age: 30

Diff for: 04_Day_Conditionals/04_day_starter/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
5-
<title>30DaysOfJavaScript</title>
5+
<title>30DaysOfJavaScript</title>
66
</head>
77

88
<body>
99

10-
<!-- import your scripts here -->
11-
<script src="./scripts/main.js"></script>
10+
<!-- import your scripts here -->
11+
<script src="./scripts/main.js"></script>
1212

1313
</body>
1414

0 commit comments

Comments
 (0)