typo error has been fixed and flag and Polish lang 🔥

pull/294/head
Milan960 4 years ago
parent 5f95530222
commit 46b4d9bea9

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

@ -1,45 +1,40 @@
# 30 Days Of JavaScript # 30 Days Of JavaScript
| # Day | Topics | | # Day | Topics |
| ----- | :-------------------------------------------------------------------------------------------------------------------------------------------------: | | ----- | :-----------------------------------------------------------------------------------------------------------------------------------------------: |
| 01 | [wprowadzenie](./readMe.md) | | 01 | [wprowadzenie](./readMe.md) |
| 02 | [Typy danych](./02_Day_Data_types/02_day_data_types.md) | | 02 | [Typy danych](./02_Day_Data_types/02_day_data_types.md) |
| 03 | [Boole'a, operatory, data](./03_Day_Booleans_operators_date/03_booleans_operators_date.md) | | 03 | [Boole'a, operatory, data](./03_Day_Booleans_operators_date/03_booleans_operators_date.md) |
| 04 | [Warunkowe](./04_Day_Conditionals/04_day_conditionals.md) | | 04 | [Warunkowe](./04_Day_Conditionals/04_day_conditionals.md) |
| 05 | [Tablice](./05_Day_Arrays/05_day_arrays.md) | | 05 | [Tablice](./05_Day_Arrays/05_day_arrays.md) |
| 06 | [Pętle](./06_Day_Loops/06_day_loops.md) | | 06 | [Pętle](./06_Day_Loops/06_day_loops.md) |
| 07 | [Funkcje](./07_Day_Functions/07_day_functions.md) | | 07 | [Funkcje](./07_Day_Functions/07_day_functions.md) |
| 08 | [Obiekty](./08_Day_Objects/08_day_objects.md) | | 08 | [Obiekty](./08_Day_Objects/08_day_objects.md) |
| 09 | [Funkcje wyższego rzędu](./09_Day_Higher_order_functions/09_day_higher_order_functions.md) | | 09 | [Funkcje wyższego rzędu](./09_Day_Higher_order_functions/09_day_higher_order_functions.md) |
| 10 | [Zestawy i mapy](./10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md) | | 10 | [Zestawy i mapy](./10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md) |
| 11 | [Destrukturyzacja i rozprzestrzenianie](./11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md) | | 11 | [Destrukturyzacja i rozprzestrzenianie](./11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md) |
| 12 | [Wyrażenia regularne](./12_Day_Regular_expressions/12_day_regular_expressions.md) | | 12 | [Wyrażenia regularne](./12_Day_Regular_expressions/12_day_regular_expressions.md) |
| 13 | [Metody obiektów konsoli](./13_Day_Console_object_methods/13_day_console_object_methods.md) | | 13 | [Metody obiektów konsoli](./13_Day_Console_object_methods/13_day_console_object_methods.md) |
| 14 | [Obsługa błędów](./14_Day_Error_handling/14_day_error_handling.md) | | 14 | [Obsługa błędów](./14_Day_Error_handling/14_day_error_handling.md) |
| 15 | [Klasy](./15_Day_Classes/15_day_classes.md) | | 15 | [Klasy](./15_Day_Classes/15_day_classes.md) |
| 16 | [JSON](./16_Day_JSON/16_day_json.md) | | 16 | [JSON](./16_Day_JSON/16_day_json.md) |
| 17 | [Magazyny internetowe](./17_Day_Web_storages/17_day_web_storages.md) | | 17 | [Magazyny internetowe](./17_Day_Web_storages/17_day_web_storages.md) |
| 18 | [Obietnice](./18_Day_Promises/18_day_promises.md) | | 18 | [Obietnice](./18_Day_Promises/18_day_promises.md) |
| 19 | [Zamknięcie](./19_Day_Closures/19_day_closures.md) | | 19 | [Zamknięcie](./19_Day_Closures/19_day_closures.md) |
| 20 | [Pisanie czystego kodu](./20_Day_Writing_clean_codes/20_day_writing_clean_codes.md) | | 20 | [Pisanie czystego kodu](./20_Day_Writing_clean_codes/20_day_writing_clean_codes.md) |
| 21 | [DOM](./21_Day_DOM/21_day_dom.md) | | 21 | [DOM](./21_Day_DOM/21_day_dom.md) |
| 22 | [Manipulowanie obiektem DOM](./22_Day_Manipulating_DOM_object/22_day_manipulating_DOM_object.md) | | 22 | [Manipulowanie obiektem DOM](./22_Day_Manipulating_DOM_object/22_day_manipulating_DOM_object.md) |
| 23 | [Słuchacze zdarzeń](./23_Day_Event_listeners/23_day_event_listeners.md) | | 23 | [Słuchacze zdarzeń](./23_Day_Event_listeners/23_day_event_listeners.md) |
| 24 | [Mini Projekt: Układ Słoneczny](./24_Day_Project_solar_system/24_day_project_solar_system.md) | | 24 | [Mini Projekt: Układ Słoneczny](./24_Day_Project_solar_system/24_day_project_solar_system.md) |
| 25 | [Mini Projekt: Wizualizacja danych krajów świata 1](./25_Day_World_countries_data_visualization_1/25_day_world_countries_data_visualization_1.md) | | 25 | [Mini Projekt: Wizualizacja danych krajów świata 1](./25_Day_World_countries_data_visualization_1/25_day_world_countries_data_visualization_1.md) |
| 26 | [Mini Projekt: Wizualizacja danych krajów świata 2](./26_Day_World_countries_data_visualization_2/26_day_world_countries_data_visualization_2.md) | | 26 | [Mini Projekt: Wizualizacja danych krajów świata 2](./26_Day_World_countries_data_visualization_2/26_day_world_countries_data_visualization_2.md) |
| 27 | [Mini Projekt: Portfolio](./27_Day_Mini_project_portfolio/27_day_mini_project_portfolio.md) | | 27 | [Mini Projekt: Portfolio](./27_Day_Mini_project_portfolio/27_day_mini_project_portfolio.md) |
| 28 | [Mini projekt: Tablica wyników](./28_Day_Mini_project_leaderboard/28_day_mini_project_leaderboard.md) | | 28 | [Mini projekt: Tablica wyników](./28_Day_Mini_project_leaderboard/28_day_mini_project_leaderboard.md) |
| 29 | [Mini Projekt: animowane postacie](./29_Day_Mini_project_animating_characters/29_day_mini_project_animating_characters.md) | | 29 | [Mini Projekt: animowane postacie](./29_Day_Mini_project_animating_characters/29_day_mini_project_animating_characters.md) |
| 30 | [Projekty końcowe](./30_Day_Mini_project_final/30_day_mini_project_final.md) | | 30 | [Projekty końcowe](./30_Day_Mini_project_final/30_day_mini_project_final.md) |
🧡🧡🧡 HAPPY CODING 🧡🧡🧡 🧡🧡🧡 HAPPY CODING 🧡🧡🧡
<div>
<small>Support the <strong>author</strong> to create more educational materials</small> <br />
<a href = "https://www.paypal.me/asabeneh"><img src='./images/paypal_lg.png' alt='Paypal Logo' style="width:10%"/></a>
</div>
<div align="center"> <div align="center">
<h1> 30 Days Of JavaScript: Introduction</h1> <h1> 30 Days Of JavaScript: Introduction</h1>
<a class="header-badge" target="_blank" href="https://www.linkedin.com/in/asabeneh/"> <a class="header-badge" target="_blank" href="https://www.linkedin.com/in/asabeneh/">
@ -74,36 +69,36 @@ KR [Korean](./Korea/README.md)
- [30 Days Of JavaScript](#30-days-of-javascript) - [30 Days Of JavaScript](#30-days-of-javascript)
- [📔 Day 1](#-day-1) - [📔 Day 1](#-day-1)
- [Introduction](#introduction) - [Introduction](#introduction)
- [Requirements](#requirements) - [Requirements](#requirements)
- [Setup](#setup) - [Setup](#setup)
- [Install Node.js](#install-nodejs) - [Install Node.js](#install-nodejs)
- [Browser](#browser) - [Browser](#browser)
- [Installing Google Chrome](#installing-google-chrome) - [Installing Google Chrome](#installing-google-chrome)
- [Opening Google Chrome Console](#opening-google-chrome-console) - [Opening Google Chrome Console](#opening-google-chrome-console)
- [Writing Code on Browser Console](#writing-code-on-browser-console) - [Writing Code on Browser Console](#writing-code-on-browser-console)
- [Console.log](#consolelog) - [Console.log](#consolelog)
- [Console.log with Multiple Arguments](#consolelog-with-multiple-arguments) - [Console.log with Multiple Arguments](#consolelog-with-multiple-arguments)
- [Comments](#comments) - [Comments](#comments)
- [Syntax](#syntax) - [Syntax](#syntax)
- [Arithmetics](#arithmetics) - [Arithmetics](#arithmetics)
- [Code Editor](#code-editor) - [Code Editor](#code-editor)
- [Installing Visual Studio Code](#installing-visual-studio-code) - [Installing Visual Studio Code](#installing-visual-studio-code)
- [How to Use Visual Studio Code](#how-to-use-visual-studio-code) - [How to Use Visual Studio Code](#how-to-use-visual-studio-code)
- [Adding JavaScript to a Web Page](#adding-javascript-to-a-web-page) - [Adding JavaScript to a Web Page](#adding-javascript-to-a-web-page)
- [Inline Script](#inline-script) - [Inline Script](#inline-script)
- [Internal Script](#internal-script) - [Internal Script](#internal-script)
- [External Script](#external-script) - [External Script](#external-script)
- [Multiple External Scripts](#multiple-external-scripts) - [Multiple External Scripts](#multiple-external-scripts)
- [Introduction to Data types](#introduction-to-data-types) - [Introduction to Data types](#introduction-to-data-types)
- [Numbers](#numbers) - [Numbers](#numbers)
- [Strings](#strings) - [Strings](#strings)
- [Booleans](#booleans) - [Booleans](#booleans)
- [Undefined](#undefined) - [Undefined](#undefined)
- [Null](#null) - [Null](#null)
- [Checking Data Types](#checking-data-types) - [Checking Data Types](#checking-data-types)
- [Comments Again](#comments-again) - [Comments Again](#comments-again)
- [Variables](#variables) - [Variables](#variables)
- [💻 Day 1: Exercises](#-day-1-exercises) - [💻 Day 1: Exercises](#-day-1-exercises)
# 📔 Day 1 # 📔 Day 1
@ -203,7 +198,7 @@ Ctl+Shift+I
To write our first JavaScript code, we used a built-in function **console.log()**. We passed an argument as input data, and the function displays the output. We passed `'Hello, World'` as input data or argument in the console.log() function. To write our first JavaScript code, we used a built-in function **console.log()**. We passed an argument as input data, and the function displays the output. We passed `'Hello, World'` as input data or argument in the console.log() function.
```js ```js
console.log('Hello, World!') console.log("Hello, World!");
``` ```
##### Console.log with Multiple Arguments ##### Console.log with Multiple Arguments
@ -213,9 +208,9 @@ The **`console.log()`** function can take multiple parameters separated by comma
![console log multiple arguments](./images/console_log_multipl_arguments.png) ![console log multiple arguments](./images/console_log_multipl_arguments.png)
```js ```js
console.log('Hello', 'World', '!') console.log("Hello", "World", "!");
console.log('HAPPY', 'NEW', 'YEAR', 2020) console.log("HAPPY", "NEW", "YEAR", 2020);
console.log('Welcome', 'to', 30, 'Days', 'Of', 'JavaScript') console.log("Welcome", "to", 30, "Days", "Of", "JavaScript");
``` ```
As you can see from the snippet code above, _`console.log()`_ can take multiple arguments. As you can see from the snippet code above, _`console.log()`_ can take multiple arguments.
@ -253,17 +248,17 @@ Programming languages are similar to human languages. English or many other lang
I made a deliberate mistake. As a result, the console raises syntax errors. Actually, the syntax is very informative. It informs what type of mistake was made. By reading the error feedback guideline, we can correct the syntax and fix the problem. The process of identifying and removing errors from a program is called debugging. Let us fix the errors: I made a deliberate mistake. As a result, the console raises syntax errors. Actually, the syntax is very informative. It informs what type of mistake was made. By reading the error feedback guideline, we can correct the syntax and fix the problem. The process of identifying and removing errors from a program is called debugging. Let us fix the errors:
```js ```js
console.log('Hello, World!') console.log("Hello, World!");
console.log('Hello, World!') console.log("Hello, World!");
``` ```
So far, we saw how to display text using the _`console.log()`_. If we are printing text or string using _`console.log()`_, the text has to be inside the single quotes, double quotes, or a backtick. So far, we saw how to display text using the _`console.log()`_. If we are printing text or string using _`console.log()`_, the text has to be inside the single quotes, double quotes, or a backtick.
**Example:** **Example:**
```js ```js
console.log('Hello, World!') console.log("Hello, World!");
console.log("Hello, World!") console.log("Hello, World!");
console.log(`Hello, World!`) console.log(`Hello, World!`);
``` ```
#### Arithmetics #### Arithmetics
@ -275,12 +270,12 @@ It is possible to write JavaScript code on Google Chrome console can directly wi
![Arithmetic](images/arithmetic.png) ![Arithmetic](images/arithmetic.png)
```js ```js
console.log(2 + 3) // Addition console.log(2 + 3); // Addition
console.log(3 - 2) // Subtraction console.log(3 - 2); // Subtraction
console.log(2 * 3) // Multiplication console.log(2 * 3); // Multiplication
console.log(3 / 2) // Division console.log(3 / 2); // Division
console.log(3 % 2) // Modulus - finding remainder console.log(3 % 2); // Modulus - finding remainder
console.log(3 ** 2) // Exponentiation 3 ** 2 == 3 * 3 console.log(3 ** 2); // Exponentiation 3 ** 2 == 3 * 3
``` ```
### Code Editor ### Code Editor
@ -353,7 +348,7 @@ First, let us write on the head part of the page.
<head> <head>
<title>30DaysOfScript:Internal Script</title> <title>30DaysOfScript:Internal Script</title>
<script> <script>
console.log('Welcome to 30DaysOfJavaScript') console.log("Welcome to 30DaysOfJavaScript");
</script> </script>
</head> </head>
<body></body> <body></body>
@ -371,7 +366,7 @@ This is how we write an internal script most of the time. Writing the JavaScript
<body> <body>
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button> <button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
<script> <script>
console.log('Welcome to 30DaysOfJavaScript') console.log("Welcome to 30DaysOfJavaScript");
</script> </script>
</body> </body>
</html> </html>
@ -387,7 +382,7 @@ Similar to the internal script, the external script link can be on the header or
First, we should create an external JavaScript file with .js extension. All files ending with .js extension are JavaScript files. Create a file named introduction.js inside your project directory and write the following code and link this .js file at the bottom of the body. First, we should create an external JavaScript file with .js extension. All files ending with .js extension are JavaScript files. Create a file named introduction.js inside your project directory and write the following code and link this .js file at the bottom of the body.
```js ```js
console.log('Welcome to 30DaysOfJavaScript') console.log("Welcome to 30DaysOfJavaScript");
``` ```
External scripts in the _head_: External scripts in the _head_:
@ -427,7 +422,7 @@ We can also link multiple external JavaScript files to a web page.
Create a `helloworld.js` file inside the 30DaysOfJS folder and write the following code. Create a `helloworld.js` file inside the 30DaysOfJS folder and write the following code.
```js ```js
console.log('Hello, World!') console.log("Hello, World!");
``` ```
```html ```html
@ -467,16 +462,15 @@ A collection of one or more characters between two single quotes, double quotes,
**Example:** **Example:**
```js ```js
'a' "a";
'Asabeneh' "Asabeneh";
"Asabeneh" "Asabeneh";
'Finland' "Finland";
'JavaScript is a beautiful programming language' "JavaScript is a beautiful programming language";
'I love teaching' "I love teaching";
'I hope you are enjoying the first day' "I hope you are enjoying the first day"`We can also create a string using a backtick`;
`We can also create a string using a backtick` ("A string could be just as small as one character or as big as many pages");
'A string could be just as small as one character or as big as many pages' ("Any data type under a single quote, double quote or backtick is a string");
'Any data type under a single quote, double quote or backtick is a string'
``` ```
### Booleans ### Booleans
@ -488,8 +482,8 @@ A boolean data type is either a true or false value.
**Example:** **Example:**
```js ```js
true // if the light is on, the value is true true; // if the light is on, the value is true
false // if the light is off, the value is false false; // if the light is off, the value is false
``` ```
### Undefined ### Undefined
@ -497,8 +491,8 @@ false // if the light is off, the value is false
In JavaScript, if we don't assign a value to a variable, the value is undefined. In addition to that, if a function is not returning anything, it returns undefined. In JavaScript, if we don't assign a value to a variable, the value is undefined. In addition to that, if a function is not returning anything, it returns undefined.
```js ```js
let firstName let firstName;
console.log(firstName) // undefined, because it is not assigned to a value yet console.log(firstName); // undefined, because it is not assigned to a value yet
``` ```
### Null ### Null
@ -506,7 +500,7 @@ console.log(firstName) // undefined, because it is not assigned to a value yet
Null in JavaScript means an empty value. Null in JavaScript means an empty value.
```js ```js
let emptyValue = null let emptyValue = null;
``` ```
## Checking Data Types ## Checking Data Types
@ -514,11 +508,11 @@ let emptyValue = null
To check the data type of a certain variable, we use the **typeof** operator. See the following example. To check the data type of a certain variable, we use the **typeof** operator. See the following example.
```js ```js
console.log(typeof 'Asabeneh') // string console.log(typeof "Asabeneh"); // string
console.log(typeof 5) // number console.log(typeof 5); // number
console.log(typeof true) // boolean console.log(typeof true); // boolean
console.log(typeof null) // object type console.log(typeof null); // object type
console.log(typeof undefined) // undefined console.log(typeof undefined); // undefined
``` ```
## Comments Again ## Comments Again
@ -562,25 +556,25 @@ A valid JavaScript variable name must follow the following rules:
The following are examples of valid JavaScript variables. The following are examples of valid JavaScript variables.
```js ```js
firstName firstName;
lastName lastName;
country country;
city city;
capitalCity capitalCity;
age age;
isMarried isMarried;
first_name first_name;
last_name last_name;
is_married is_married;
capital_city capital_city;
num1 num1;
num_1 num_1;
_num_1 _num_1;
$num1 $num1;
year2020 year2020;
year_2020 year_2020;
``` ```
The first and second variables on the list follows the camelCase convention of declaring in JavaScript. In this material, we will use camelCase variables(camelWithOneHump). We use CamelCase(CamelWithTwoHump) to declare classes, we will discuss about classes and objects in other section. The first and second variables on the list follows the camelCase convention of declaring in JavaScript. In this material, we will use camelCase variables(camelWithOneHump). We use CamelCase(CamelWithTwoHump) to declare classes, we will discuss about classes and objects in other section.
@ -597,7 +591,7 @@ Let us declare variables with different data types. To declare a variable, we ne
```js ```js
// Syntax // Syntax
let nameOfVariable = value let nameOfVariable = value;
``` ```
The nameOfVriable is the name that stores different data of value. See below for detail examples. The nameOfVriable is the name that stores different data of value. See below for detail examples.
@ -606,14 +600,14 @@ The nameOfVriable is the name that stores different data of value. See below for
```js ```js
// Declaring different variables of different data types // Declaring different variables of different data types
let firstName = 'Asabeneh' // first name of a person let firstName = "Asabeneh"; // first name of a person
let lastName = 'Yetayeh' // last name of a person let lastName = "Yetayeh"; // last name of a person
let country = 'Finland' // country let country = "Finland"; // country
let city = 'Helsinki' // capital city let city = "Helsinki"; // capital city
let age = 100 // age in years let age = 100; // age in years
let isMarried = true let isMarried = true;
console.log(firstName, lastName, country, city, age, isMarried) console.log(firstName, lastName, country, city, age, isMarried);
``` ```
```sh ```sh
@ -622,11 +616,11 @@ Asabeneh Yetayeh Finland Helsinki 100 true
```js ```js
// Declaring variables with number values // Declaring variables with number values
let age = 100 // age in years let age = 100; // age in years
const gravity = 9.81 // earth gravity in m/s2 const gravity = 9.81; // earth gravity in m/s2
const boilingPoint = 100 // water boiling point, temperature in °C const boilingPoint = 100; // water boiling point, temperature in °C
const PI = 3.14 // geometrical constant const PI = 3.14; // geometrical constant
console.log(gravity, boilingPoint, PI) console.log(gravity, boilingPoint, PI);
``` ```
```sh ```sh
@ -635,8 +629,10 @@ console.log(gravity, boilingPoint, PI)
```js ```js
// Variables can also be declaring in one line separated by comma, however I recommend to use a seperate line to make code more readble // Variables can also be declaring in one line separated by comma, however I recommend to use a seperate line to make code more readble
let name = 'Asabeneh', job = 'teacher', live = 'Finland' let name = "Asabeneh",
console.log(name, job, live) job = "teacher",
live = "Finland";
console.log(name, job, live);
``` ```
```sh ```sh

Loading…
Cancel
Save