Skip to content

Commit 5a95f04

Browse files
committed
restructuring
1 parent 57ab3f2 commit 5a95f04

10 files changed

Lines changed: 44 additions & 38 deletions

File tree

01_Day/01_day_starter/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
</head>
77

88
<body>
9+
<h1>30DaysOfJavaScript:03 Day</h1>
10+
<h2>Introduction</h2>
911
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
1012
<script src="./helloworld.js"></script>
1113
<script src="./introduction.js"></script>

02_Day/02_day_starter/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
</head>
77

88
<body>
9+
<h1>30DaysOfJavaScript:02 Day</h1>
10+
<h2>Data types</h2>
911

1012
<!-- import your scripts here -->
1113
<script src="./main.js"></script>

03_Day/03_day_starter/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
</head>
77

88
<body>
9+
<h1>30DaysOfJavaScript:03 Day</h1>
10+
<h2>Booleans, undefined, null, date object</h2>
911

1012
<!-- import your scripts here -->
1113
<script src="./scripts/main.js"></script>

04_Day/04_day_starter/04_day_starter/index.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

04_Day/04_day_starter/04_day_starter/scripts/main.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

04_Day/04_day_starter/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33

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

88
<body>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
// this is your main.js script
1+
// this is your main.js script
2+
3+
alert('Open the browser console whenever you work on JavaScript')

05_Day/05_day_starter/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
</head>
77

88
<body>
9+
<h1>30DaysOfJavaScript:05 Day</h1>
10+
<h2>Arrays</h2>
911

1012
<script src="./data/countries.js"></script>
1113
<script src="./scripts/main.js"></script>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
console.log(countries)
2+
alert('Open the browser console whenever you work on JavaScript')
23
alert('Open the console and check if the countries has been loaded')

readMe.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,15 @@ If you installed visual studio code, let us start using it.
227227
Open the visual studio code by double-clicking the visual studio icon. When you open it, you will get this kind of interface. Try to interact with the labeled icons.
228228

229229
![Vscode ui](./images/vscode_ui.png)
230+
230231
![Vscode add project](./images/adding_project_to_vscode.png)
232+
231233
![Vscode open project](./images/opening_project_on_vscode.png)
234+
232235
![script file](images/scripts_on_vscode.png)
236+
233237
![running script](./images/running_script.png)
238+
234239
![coding running](./images/launched_on_new_tab.png)
235240

236241
## Adding JavaScript to a web page
@@ -298,6 +303,7 @@ This is how we write the internal script most of the time. Writing the JavaScrip
298303
```
299304

300305
Open the browser console to see the output from the console.log()
306+
301307
![js code from vscode](./images/js_code_vscode.png)
302308

303309
### External script
@@ -320,7 +326,7 @@ External scripts in the head
320326
</head>
321327
<body>
322328
</body>
323-
</html
329+
</html>
324330
```
325331

326332
External scripts in the body
@@ -336,7 +342,7 @@ External scripts in the body
336342
// Here is the recommended place to put the external script
337343
<script src="introduction.js"></script>
338344
</body>
339-
</html
345+
</html>
340346
```
341347

342348
Open the browser console to see the output from the console.log()
@@ -361,10 +367,11 @@ console.log('Hello, World!')
361367
<script src ="./helloworld.js"></script>
362368
<script src="./introduction.js"></script>
363369
</body>
364-
</html
370+
</html>
365371
```
366372

367373
Your main.js file should be below all other scripts. Watch out your exercise needs to understand this line.
374+
368375
![Multiple Script](./images/multiple_script.png)
369376

370377
## Introduction to Data types
@@ -403,8 +410,8 @@ A boolean data type is either a True or False value.
403410
**Example:**
404411

405412
```js
406-
true # if the light on ,the value is true
407-
false # if the light off, the value is False
413+
true // if the light on ,the value is true
414+
false // if the light off, the value is False
408415
```
409416

410417
### Undefined
@@ -431,8 +438,8 @@ To check the data type of a certain data type, we use the **typeof** operator. S
431438
```js
432439
console.log(typeof 'Asabeneh') // string
433440
console.log(typeof 5) // number
434-
console.log(typeof true ) // boolean
435-
console.log(typeof null) // object type
441+
console.log(typeof true ) // boolean
442+
console.log(typeof null) // object type
436443
console.log(typeof undefined) // undefined
437444
```
438445

@@ -445,6 +452,7 @@ There are two ways of commenting:
445452
- _Multiline commenting_
446453

447454
```js
455+
// commenting the code itself with a single comment
448456
// let firstName = 'Asabeneh'; single line comment
449457
// let lastName = 'Yetayeh'; single line comment
450458
```
@@ -466,10 +474,10 @@ Variables are _containers_ of data. Variables used to _store_ data in a memory l
466474

467475
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*.
468476

469-
* A JavaScript variable name should not begin with a number.
470-
* A JavaScript variable name does not allow special characters except dollar sign and underscore.
471-
* A JavaScript variable name follows a camelCase convention.
472-
* A JavaScript variable name should not have space between words.
477+
- A JavaScript variable name should not begin with a number.
478+
- A JavaScript variable name does not allow special characters except dollar sign and underscore.
479+
- A JavaScript variable name follows a camelCase convention.
480+
- A JavaScript variable name should not have space between words.
473481

474482
The following are valid examples of JavaScript variables.
475483
Valid variables in JavaScript:
@@ -516,21 +524,24 @@ Let us declare variables with different data types. To declare a variable, we ne
516524

517525
```js
518526
// Declaring different variables of different data types
519-
let firstName = 'Asabeneh' // first name of a person
520-
let lastName = 'Yetayeh' // last name of a person
521-
let country = 'Finland' // country
522-
let city = 'Helsinki' // capital city
523-
let age = 100 // age in years
527+
528+
let firstName = 'Asabeneh' // first name of a person
529+
let lastName = 'Yetayeh' // last name of a person
530+
let country = 'Finland' // country
531+
let city = 'Helsinki' // capital city
532+
let age = 100 // age in years
524533
let isMarried = true
534+
525535
console.log(firstName, lastName, country, city, age, isMarried); //Asabeneh, Yetayeh, Finland, Helsinki, 100, True
526536

527537
// Declaring variables with number values
528-
const gravity = 9.81; // earth gravity in m/s2
529-
const boilingPoint = 100; // water boiling point, temperature in oC
530-
const PI = 3.14; // geometrical constant
538+
const gravity = 9.81 // earth gravity in m/s2
539+
const boilingPoint = 100 // water boiling point, temperature in oC
540+
const PI = 3.14 // geometrical constant
541+
531542
console.log(gravity, boilingPoint, PI); // 9.81, 100, 3.14
532543
// Variables can also be declaring in one line separated by comma
533-
let name = 'Asabeneh', //name of a person
544+
let name = 'Asabeneh', // name of a person
534545
job = 'teacher',
535546
live = 'Finland';
536547
console.log(name, job, live);

0 commit comments

Comments
 (0)