You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 03_Day_Booleans_operators_date/03_booleans_operators_date.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -382,7 +382,7 @@ These are not all the window methods we will have a separate section to go deep
382
382
## Date Object
383
383
384
384
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.
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)
Copy file name to clipboardExpand all lines: 18_Day_Promises/18_day_promises.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,8 @@ doPromise
172
172
The Fetch API provides an interface for fetching resources (including across the network). It will seem familiar to anyone who has used XMLHttpRequest, but the new API provides a more powerful and flexible feature set. In this challenge we will use fetch to request url and APIS. In addition to that let us see demonstrate use case of promises in accessing network resources using the fetch API.
173
173
174
174
```js
175
-
consturl='https://restcountries.eu/rest/v2/all'// countries api
175
+
176
+
consturl='https://restcountries.com/v2/all'// countries api
176
177
fetch(url)
177
178
.then(response=>response.json()) // accessing the API data as JSON
178
179
.then(data=> { // getting the data
@@ -219,7 +220,7 @@ Let us fetch API data using both promise method and async and await method.
Most people get confused between _textContent_ and _innerHTML_. _textContent_ is meant to add text to an HTML element, however innerHTML can add a text or HTML element or elements as a child.
Copy file name to clipboardExpand all lines: readMe.md
+14-15
Original file line number
Diff line number
Diff line change
@@ -205,7 +205,7 @@ console.log('Hello, World!')
205
205
206
206
##### Console.log with Multiple Arguments
207
207
208
-
The **conole.log()** function can take multiple parameters separated by comma. The syntax looks like as follows:**console.log(param1, param2, param3)**
208
+
The **console.log()** function can take multiple parameters separated by comma. The syntax looks like as follows:**console.log(param1, param2, param3)**
@@ -231,11 +231,11 @@ We add comments to our code. Comments are very important to make code more reada
231
231
232
232
**Example: Multiline Comment**
233
233
234
-
/_
234
+
/*
235
235
This is a multiline comment
236
236
Multiline comments can take multiple lines
237
237
JavaScript is the language of the web
238
-
_/
238
+
*/
239
239
240
240
##### Syntax
241
241
@@ -527,18 +527,18 @@ Multiline commenting:
527
527
528
528
```js
529
529
/*
530
-
let location = 'Helsinki';
531
-
let age = 100;
532
-
let isMarried = true;
533
-
This is a Multiple line comment
534
-
*/
530
+
let location = 'Helsinki';
531
+
let age = 100;
532
+
let isMarried = true;
533
+
This is a Multiple line comment
534
+
*/
535
535
```
536
536
537
537
## Variables
538
538
539
539
Variables are _containers_ of data. Variables are used to _store_ data in a memory location. When a variable is declared, a memory location is reserved. When a variable is assigned to a value (data), the memory space will be filled with that data. To declare a variable, we use _var_, _let_, or _const_ keywords.
540
540
541
-
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_. We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.
541
+
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 not change, and we can use _const_. We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.
542
542
543
543
A valid JavaScript variable name must follow the following rules:
544
544
@@ -571,7 +571,7 @@ year2020
571
571
year_2020
572
572
```
573
573
574
-
The first and second variables on the list follows the camelCase convention of declaring in JavaScrip. In this material, we will use camelCase variables.
574
+
The first and second variables on the list follows the camelCase convention of declaring in JavaScript. In this material, we will use camelCase variables.
575
575
576
576
Example of invalid variables:
577
577
@@ -603,16 +603,15 @@ console.log(firstName, lastName, country, city, age, isMarried)
603
603
```
604
604
605
605
```sh
606
-
Asabeneh Yetayeh Finland Helsinki 100 True
606
+
Asabeneh Yetayeh Finland Helsinki 100 true
607
607
```
608
608
609
609
```js
610
610
// Declaring variables with number values
611
611
let age =100// age in years
612
612
constgravity=9.81// earth gravity in m/s2
613
-
constboilingPoint=100// water boiling point, temperature in oC
613
+
constboilingPoint=100// water boiling point, temperature in °C
0 commit comments