From 228caaa2e3867948d5d7c9eef4ff01fb7d1e2a0e Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 14:01:30 +0200 Subject: [PATCH 1/6] Aze translation - first step --- Azerbaijani/readMe.md | 663 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 663 insertions(+) create mode 100644 Azerbaijani/readMe.md diff --git a/Azerbaijani/readMe.md b/Azerbaijani/readMe.md new file mode 100644 index 0000000..a96fa9a --- /dev/null +++ b/Azerbaijani/readMe.md @@ -0,0 +1,663 @@ +# 30 Günlük JavaScript dərsləri + +| # Gün | Mövzular | +| ----- | :-------------------------------------------------------------------------------------------------------------------------------------------------: | +| 01 | [Giriş](./readMe.md) | +| 02 | [Data Types](./02_Day_Data_types/02_day_data_types.md) | +| 03 | [Booleans, Operators, Date](./03_Day_Booleans_operators_date/03_booleans_operators_date.md) | +| 04 | [Conditionals](./04_Day_Conditionals/04_day_conditionals.md) | +| 05 | [Arrays](./05_Day_Arrays/05_day_arrays.md) | +| 06 | [Loops](./06_Day_Loops/06_day_loops.md) | +| 07 | [Functions](./07_Day_Functions/07_day_functions.md) | +| 08 | [Objects](./08_Day_Objects/08_day_objects.md) | +| 09 | [Higher Order Functions](./09_Day_Higher_order_functions/09_day_higher_order_functions.md) | +| 10 | [Sets and Maps](./10_Day_Sets_and_Maps/10_day_Sets_and_Maps.md) | +| 11 | [Destructuring and Spreading](./11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md) | +| 12 | [Regular Expressions](./12_Day_Regular_expressions/12_day_regular_expressions.md) | +| 13 | [Console Object Methods](./13_Day_Console_object_methods/13_day_console_object_methods.md) | +| 14 | [Error Handling](./14_Day_Error_handling/14_day_error_handling.md) | +| 15 | [Classes](./15_Day_Classes/15_day_classes.md) | +| 16 | [JSON](./16_Day_JSON/16_day_json.md) | +| 17 | [Web Storages](./17_Day_Web_storages/17_day_web_storages.md) | +| 18 | [Promises](./18_Day_Promises/18_day_promises.md) | +| 19 | [Closure](./19_Day_Closures/19_day_closures.md) | +| 20 | [Writing Clean Code](./20_Day_Writing_clean_codes/20_day_writing_clean_codes.md) | +| 21 | [DOM](./21_Day_DOM/21_day_dom.md) | +| 22 | [Manipulating DOM Object](./22_Day_Manipulating_DOM_object/22_day_manipulating_DOM_object.md) | +| 23 | [Event Listeners](./23_Day_Event_listeners/23_day_event_listeners.md) | +| 24 | [Mini Project: Solar System](./24_Day_Project_solar_system/24_day_project_solar_system.md) | +| 25 | [Mini Project: World Countries Data Visulalization 1](./25_Day_World_countries_data_visualization_1/25_day_world_countries_data_visualization_1.md) | +| 26 | [Mini Project: World Countries Data Visulalization 2](./26_Day_World_countries_data_visualization_2/26_day_world_countries_data_visualization_2.md) | +| 27 | [Mini Project: Portfolio](./27_Day_Mini_project_portfolio/27_day_mini_project_portfolio.md) | +| 28 | [Mini Project: Leaderboard](./28_Day_Mini_project_leaderboard/28_day_mini_project_leaderboard.md) | +| 29 | [Mini Project:Animating characters](./29_Day_Mini_project_animating_characters/29_day_mini_project_animating_characters.md) | +| 30 | [Final Projects](./30_Day_Mini_project_final/30_day_mini_project_final.md) | + +🧡🧡🧡 Xoş kodlamalar 🧡🧡🧡 + +
+Müəllifi dəstəkləməklə daha çox təhsil materialı yaratmasına kömək ola bilərsiniz
+Paypal Logo +
+ +
+

30 Günlük JavaScript: Giriş

+ + + + + Twitter Follow + + +Author: +Asabeneh Yetayeh
+ Yanvar, 2020 +
+ +
+ +🇬🇧 [English](./readMe.md) +🇪🇸 [Spanish](./Spanish/readme.md) +🇷🇺 [Russian](./RU/README.md) +Az [Azerbaijan](./Azerbaijani/readMe.md) + +
+ +
+ + +[Gün 2 >>](./02_Day_Data_types/02_day_data_types.md) + +![30 Günlük JavaScript dərsləri](./images/day_1_1.png) + +- [30 Günlük JavaScript dərsləri](#30-days-of-javascript) +- [📔 Gün 1](#-day-1) + - [Giriş](#introduction) + - [İlkin tələblər](#requirements) + - [Hazırlıq](#setup) + - [Node.js yüklə](#install-nodejs) + - [Brauzer](#browser) + - [Google Chrome yüklənməsi](#installing-google-chrome) + - [Google Chrome brauzer konsolu açmaq](#opening-google-chrome-console) + - [Brauzer konsolunda kod yazılması](#writing-code-on-browser-console) + - [Console.log](#consolelog) + - [Console.log - birneçə arqument ilə](#consolelog-with-multiple-arguments) + - [Şərhlər](#comments) + - [Sintaksis](#syntax) + - [Riyazi əməliyyatlar](#arithmetics) + - [Kod editoru](#code-editor) + - [Visual Studio Code'un yüklənməsi](#installing-visual-studio-code) + - [Visual Studio Code istifadəsi](#how-to-use-visual-studio-code) + - [Veb səhifəyə JavaScript əlavə edilməsi](#adding-javascript-to-a-web-page) + - [Sətirdaxili (inline) skript](#inline-script) + - [Daxili (internal) skript](#internal-script) + - [Xarici skript](#external-script) + - [Birneçə xarici skript](#multiple-external-scripts) + - [Verilənlərin tiplərinə giriş](#introduction-to-data-types) + - [Ədəd tipləri](#numbers) + - [Sətir tipləri](#strings) + - [Məntiqi tiplər](#booleans) + - [Undefined](#undefined) + - [Null](#null) + - [Verilənlərin tiplərinin yoxlanılması](#checking-data-types) + - [Şərhlər (daha artıq)](#comments-again) + - [Dəyişənlər](#variables) +- [💻 Gün 1: Tapşırıqlar](#-day-1-exercises) + +# 📔 Gün 1 + +## Giriş + +30 günlük JavaScript proqramlaşdırma müsabiqəsində iştirak etmək qərarına gəldiyiniz üçün sizi **təbrik edirik**. Bu çağırışda siz JavaScript proqramçısı olmaq üçün lazım olan hər şeyi və ümumiyyətlə, proqramlaşdırmanın bütün konsepsiyasını öyrənəcəksiniz. Müsabiqənin sonunda siz 30DaysOfJavaScript proqramlaşdırma testini tamamlama sertifikatı alacaqsınız. Yardıma ehtiyacınız olarsa və ya başqalarına kömək etmək istəyirsinizsə, rəsmi [telegram qrupuna](https://t.me/ThirtyDaysOfJavaScript) qoşula bilərsiniz + +**30GünlükJavaScript** çağırışı həm yeni başlayanlar, həm də təcrübəli JavaScript proqramçıları üçün bələdçidir. JavaScript-ə xoş gəlmisiniz. JavaScript internetin dilidir. Mən JavaScript istifadə etməkdən və öyrətməkdən həzz alıram və ümid edirəm ki, siz də bunu edəcəksiniz. + +Bu addım-addım JavaScript dərslərində siz bəşəriyyət tarixində ən populyar proqramlaşdırma dili olan JavaScript-i öyrənəcəksiniz.JavaScript **_veb-saytlara interaktivlik əlavə etmək, mobil proqramlar, masaüstü proqramlar, oyunlar hazırlamaq_** üçün istifadə olunur və bu gün JavaScript hətta **_maşın öyrənməsi_** və **_AI (süni intellekt)_** üçün istifadə edilə bilər. +**_JavaScript (JS)_** son illərdə populyarlığı artıb və son altı ildir ki, ardıcıl olaraq ən məhşur və ən çox istifadə olunan proqramlaşdırma dilidir +Mənbə: Github. + +## Tələblər + +İlkin olaraq heç bir proqramlaşdırma biliyi tələb olunmur. Yalnız ehtiyacınız var: + +1. Motivasiya +2. Kompüter +3. Internet +4. Brauzer +5. Kod yazmaq üçün editor + +## Hazırlıq + +İnanıram ki, sizdə proqramçı olmaq üçün kompüter, internet, motivasiya və güclü istək var. Bunlara sahibsinizsə, başlamaq üçün hər şeyiniz var. + +### Node.js-in yüklənilməsi + +İndi olmasa belə daha sonrakı addımlar üçün Node-a ehtiyaciniz var. Yükləmək üçün [buraya](https://nodejs.org/en/) istinad edin. + +![Node Yüklənməsi](images/download_node.png) + +Yükləndikdən sonra quraşdırılma üçün + +![Node quraşdırılması](images/install_node.png) + +Əməliyyat sistemi terminalımızı açaraq maşınımızda node quraşdırılıb-quraşdırılmadığını yoxlaya bilərik. + +```sh +asabeneh $ node -v +v12.14.0 +``` + +Bu dərsliyi hazırlayarkən mən Node versiyası 12.14.0-dan istifadə edirdim, lakin indi yükləmək üçün Node.js-in tövsiyə olunan versiyası v14.17.6-dır. + +### Brauzer + +Hazırda bir çox brauzer mövcud olsa da müəllif Google Chrome istifadəsini tövsiyə edir. + +#### Google Chrome yükləmək + +Google Chrome sizdə mövcud deyilsə bu [linkə](https://www.google.com/chrome/) istinad edin. Biz brauzer konsolunda kiçik JavaScript kodu yaza bilərik, lakin ciddi proqramların hazırlanması üçün brauzer konsolundan istifadə etmirik. + +![Google Chrome](images/google_chrome.png) + +#### Opening Google Chrome Console + +You can open Google Chrome console either by clicking three dots at the top right corner of the browser, selecting _More tools -> Developer tools_ or using a keyboard shortcut. I prefer using shortcuts. + +![Opening chrome](images/opening_developer_tool.png) + +To open the Chrome console using a keyboard shortcut. + +```sh +Mac +Command+Option+J + +Windows/Linux: +Ctl+Shift+J +``` + +![Opening console](images/opening_chrome_console_shortcut.png) + +After you open the Google Chrome console, try to explore the marked buttons. We will spend most of the time on the Console. The Console is the place where your JavaScript code goes. The Google Console V8 engine changes your JavaScript code to machine code. +Let us write a JavaScript code on the Google Chrome console: + +![write code on console](./images/js_code_on_chrome_console.png) + +#### Writing Code on Browser Console + +We can write any JavaScript code on the Google console or any browser console. However, for this challenge, we only focus on Google Chrome console. Open the console using: + +```sh +Mac +Command+Option+I + +Windows: +Ctl+Shift+I +``` + +##### Console.log + +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 +console.log('Hello, World!') +``` + +##### Console.log with Multiple Arguments + +The **console.log()** function can take multiple parameters separated by commas. The syntax looks like as follows:**console.log(param1, param2, param3)** + +![console log multiple arguments](./images/console_log_multipl_arguments.png) + +```js +console.log('Hello', 'World', '!') +console.log('HAPPY', 'NEW', 'YEAR', 2020) +console.log('Welcome', 'to', 30, 'Days', 'Of', 'JavaScript') +``` + +As you can see from the snippet code above, _console.log()_ can take multiple arguments. + +Congratulations! You wrote your first JavaScript code using _console.log()_. + +##### Comments + +We add comments to our code. Comments are very important to make code more readable and to leave remarks in our code. JavaScript does not execute the comment part of our code.In JavaScript, any text line starting with // in JavaScript is a comment, and anything enclosed like this /\* \*/ is also a comment. + +**Example: Single Line Comment** + +// This is the first comment + // This is the second comment + // I am a single line comment + +**Example: Multiline Comment** + +/* +This is a multiline comment + Multiline comments can take multiple lines + JavaScript is the language of the web + */ + +##### Syntax + +Programming languages are similar to human languages. English or many other language uses words, phrases, sentences,compound sentences and other more to convey a meaningful message. The English meaning of syntax is _the arrangement of words and phrases to create well-formed sentences in a language_. The technical definition of syntax is the structure of statements in a computer language.Programming languages have syntax. JavaScript is a programming language and like other programming languages it has its own syntax. If we do not write a syntax that JavaScript understands, it will raise different types of errors. We will explore different kinds of JavaScript errors later. For now, let us see syntax errors. + +![Error](images/raising_syntax_error.png) + +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 +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 quotes. +**Example:** + +```js +console.log('Hello, World!') +console.log("Hello, World!") +console.log(`Hello, World!`) +``` + +#### Arithmetics + +Now, let us practice more writing JavaScript codes using _console.log()_ on google chrome console for number data types. +In addition to the text, we can also do mathematical calculations using JavaScript. Let us do the following simple calculations. +The console can directly take arguments without the **_console.log()_** function. However, it is included in this introduction because most of this challenge would be taking place in a text editor where the usage of the function would be mandatory. You can play around directly with instructions on the console. + +![Arithmetic](images/arithmetic.png) + +```js +console.log(2 + 3) // Addition +console.log(3 - 2) // Subtraction +console.log(2 * 3) // Multiplication +console.log(3 / 2) // Division +console.log(3 % 2) // Modulus - finding remainder +console.log(3 ** 2) // Exponentiation 3 ** 2 == 3 * 3 +``` + +### Code Editor + +We can write our codes on the browser console, but it won't do for bigger projects. In a real working environment, developers use different code editors to write their codes. In this 30 days JavaScript challenge, we will be using Visual Studio Code. + +#### Installing Visual Studio Code + +Visual studio code is a very popular open-source text editor. I would recommend to [download Visual Studio Code](https://code.visualstudio.com/), but if you are in favor of other editors, feel free to follow with what you have. + +![Vscode](images/vscode.png) + +If you installed Visual Studio Code, let us start using it. + +#### How to Use Visual Studio Code + +Open the Visual Studio Code by double-clicking its icon. When you open it, you will get this kind of interface. Try to interact with the labeled icons. + +![Vscode ui](./images/vscode_ui.png) + +![Vscode add project](./images/adding_project_to_vscode.png) + +![Vscode open project](./images/opening_project_on_vscode.png) + +![script file](images/scripts_on_vscode.png) + +![Installing Live Server](images/vsc_live_server.png) + +![running script](./images/running_script.png) + +![coding running](./images/launched_on_new_tab.png) + +## Adding JavaScript to a Web Page + +JavaScript can be added to a web page in three different ways: + +- **_Inline script_** +- **_Internal script_** +- **_External script_** +- **_Multiple External scripts_** + +The following sections show different ways of adding JavaScript code to your web page. + +### Inline Script + +Create a project folder on your desktop or in any location, name it 30DaysOfJS and create an **_index.html_** file in the project folder. Then paste the following code and open it in a browser, for example [Chrome](https://www.google.com/chrome/). + +```html + + + + 30DaysOfScript:Inline Script + + + + + +``` + +Now, you just wrote your first inline script. We can create a pop up alert message using the _alert()_ built-in function. + +### Internal Script + +The internal script can be written in the _head_ or the _body_, but it is preferred to put it on the body of the HTML document. +First, let us write on the head part of the page. + +```html + + + + 30DaysOfScript:Internal Script + + + + +``` + +This is how we write an internal script most of the time. Writing the JavaScript code in the body section is the most preferred option. Open the browser console to see the output from the console.log() + +```html + + + + 30DaysOfScript:Internal Script + + + + + + +``` + +Open the browser console to see the output from the console.log() + +![js code from vscode](./images/js_code_vscode.png) + +### External Script + +Similar to the internal script, the external script link can be on the header or body, but it is preferred to put it in 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 +console.log('Welcome to 30DaysOfJavaScript') +``` + +External scripts in the _head_: + +```html + + + + 30DaysOfJavaScript:External script + + + + +``` + +External scripts in the _body_: + +```html + + + + 30DaysOfJavaScript:External script + + + + + + + +``` + +Open the browser console to see the output of the console.log() + +### Multiple External Scripts + +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. + +```js +console.log('Hello, World!') +``` + +```html + + + + Multiple External Scripts + + + + + + +``` + +_Your main.js file should be below all other scripts_. It is very important to remember this. + +![Multiple Script](./images/multiple_script.png) + +## Introduction to Data types + +In JavaScript and also other programming languages, there are different kinds of data types. The following are JavaScript primitive data types:_String, Number, Boolean, undefined, Null_, and _Symbol_. + +### Numbers + +- Integers: Integer (negative, zero and positive) numbers + Example: + ... -3, -2, -1, 0, 1, 2, 3 ... +- Float-point numbers: Decimal number + Example + ... -3.5, -2.25, -1.0, 0.0, 1.1, 2.2, 3.5 ... + +### Strings + +A collection of one or more characters between two single quotes, double quotes, or backticks. +**Example:** + +```js +'Asabeneh' +'Finland' +'JavaScript is a beautiful programming language' +'I love teaching' +'I hope you are enjoying the first day' +`We can also create a string using a backtick` +'A string could be just as small as one character as big as many pages' +``` + +### Booleans + +A boolean value is either True or False. Any comparisons returns a boolean value, which is either true or false. + +A boolean data type is either a true or false value. + +**Example:** + +```js +true // if the light is on, the value is true +false // if the light is off, the value is false +``` + +### 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 +let firstName +console.log(firstName) // undefined, because it is not assigned to a value yet +``` + +### Null + +Null in JavaScript means an empty value. + +```js +let emptyValue = null +``` + +## Checking Data Types + +To check the data type of a certain variable, we use the **typeof** operator. See the following example. + +```js +console.log(typeof 'Asabeneh') // string +console.log(typeof 5) // number +console.log(typeof true) // boolean +console.log(typeof null) // object type +console.log(typeof undefined) // undefined +``` + +## Comments Again + +Remember that commenting in JavaScript is similar to other programming languages. Comments are important in making your code more readable. +There are two ways of commenting: + +- _Single line commenting_ +- _Multiline commenting_ + +```js +// commenting the code itself with a single comment +// let firstName = 'Asabeneh'; single line comment +// let lastName = 'Yetayeh'; single line comment +``` + +Multiline commenting: + +```js +/* + let location = 'Helsinki'; + let age = 100; + let isMarried = true; + This is a Multiple line comment + +*/ +``` + +## Variables + +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. + +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. + +A valid JavaScript variable name must follow the following rules: + +- A JavaScript variable name should not begin with a number. +- A JavaScript variable name does not allow special characters except dollar sign and underscore. +- A JavaScript variable name follows a camelCase convention. +- A JavaScript variable name should not have space between words. + +The following are examples of valid JavaScript variables. + +```js +firstName +lastName +country +city +capitalCity +age +isMarried + +first_name +last_name +is_married +capital_city + +num1 +num_1 +_num_1 +$num1 +year2020 +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. + +Example of invalid variables: + +```sh + first-name + 1_num + num_#_1 +``` + +Let us declare variables with different data types. To declare a variable, we need to use _let_ or _const_ keyword before the variable name. Following the variable name, we write an equal sign (assignment operator), and a value(assigned data). + +```js +// Syntax +let nameOfVariable = value +``` + +**Examples of declared variables** + +```js +// Declaring different variables of different data types +let firstName = 'Asabeneh' // first name of a person +let lastName = 'Yetayeh' // last name of a person +let country = 'Finland' // country +let city = 'Helsinki' // capital city +let age = 100 // age in years +let isMarried = true + +console.log(firstName, lastName, country, city, age, isMarried) +``` + +```sh +Asabeneh Yetayeh Finland Helsinki 100 true +``` + +```js +// Declaring variables with number values +let age = 100 // age in years +const gravity = 9.81 // earth gravity in m/s2 +const boilingPoint = 100 // water boiling point, temperature in °C +const PI = 3.14 // geometrical constant +console.log(gravity, boilingPoint, PI) +``` + +```sh +9.81 100 3.14 +``` + +```js +// Variables can also be declaring in one line separated by comma +let name = 'Asabeneh', // name of a person +job = 'teacher', +live = 'Finland' +console.log(name, job, live) +``` + +```sh +Asabeneh teacher Finland +``` + +When you run _index.html_ file in the 01-Day folder you should get this: + +![Day one](./images/day_1.png) + +🌕 You are amazing! You have just completed day 1 challenge and you are on your way to greatness. Now do some exercises for your brain and muscle. + +# 💻 Day 1: Exercises + +1. Write a single line comment which says, _comments can make code readable_ +2. Write another single comment which says, _Welcome to 30DaysOfJavaScript_ +3. Write a multiline comment which says, _comments can make code readable, easy to reuse_ + _and informative_ + +4. Create a variable.js file and declare variables and assign string, boolean, undefined and null data types +5. Create datatypes.js file and use the JavaScript **_typeof_** operator to check different data types. Check the data type of each variable +6. Declare four variables without assigning values +7. Declare four variables with assigned values +8. Declare variables to store your first name, last name, marital status, country and age in multiple lines +9. Declare variables to store your first name, last name, marital status, country and age in a single line +10. Declare two variables _myAge_ and _yourAge_ and assign them initial values and log to the browser console. + +```sh +I am 25 years old. +You are 30 years old. +``` + +🎉 CONGRATULATIONS ! 🎉 + +[Day 2 >>](./02_Day_Data_types/02_day_data_types.md) From eb2d40f781c6f1b8f8f06b46535af0b7cdd36d08 Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 14:04:20 +0200 Subject: [PATCH 2/6] Aze translation - first step --- readMe.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readMe.md b/readMe.md index 9908fe1..2026c35 100644 --- a/readMe.md +++ b/readMe.md @@ -59,6 +59,8 @@ 🇬🇧 [English](./readMe.md) 🇪🇸 [Spanish](./Spanish/readme.md) 🇷🇺 [Russian](./RU/README.md) +Az [Azerbaijan](./Azerbaijani/readMe.md) + From 458a674af9f844307955ebb78debe3b48c61625c Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 14:06:08 +0200 Subject: [PATCH 3/6] Fix image path --- Azerbaijani/readMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Azerbaijani/readMe.md b/Azerbaijani/readMe.md index a96fa9a..35bf4ef 100644 --- a/Azerbaijani/readMe.md +++ b/Azerbaijani/readMe.md @@ -37,7 +37,7 @@
Müəllifi dəstəkləməklə daha çox təhsil materialı yaratmasına kömək ola bilərsiniz
-Paypal Logo +Paypal Logo
@@ -68,7 +68,7 @@ Az [Azerbaijan](./Azerbaijani/readMe.md) [Gün 2 >>](./02_Day_Data_types/02_day_data_types.md) -![30 Günlük JavaScript dərsləri](./images/day_1_1.png) +![30 Günlük JavaScript dərsləri](../images/day_1_1.png) - [30 Günlük JavaScript dərsləri](#30-days-of-javascript) - [📔 Gün 1](#-day-1) From f2df8bafddac9b2c6e1dd6c9303f65451d8241f0 Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 14:30:16 +0200 Subject: [PATCH 4/6] More translations into Aze --- Azerbaijani/readMe.md | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Azerbaijani/readMe.md b/Azerbaijani/readMe.md index 35bf4ef..1fdf15b 100644 --- a/Azerbaijani/readMe.md +++ b/Azerbaijani/readMe.md @@ -157,15 +157,15 @@ Hazırda bir çox brauzer mövcud olsa da müəllif Google Chrome istifadəsini Google Chrome sizdə mövcud deyilsə bu [linkə](https://www.google.com/chrome/) istinad edin. Biz brauzer konsolunda kiçik JavaScript kodu yaza bilərik, lakin ciddi proqramların hazırlanması üçün brauzer konsolundan istifadə etmirik. -![Google Chrome](images/google_chrome.png) +![Google Chrome](../images/google_chrome.png) -#### Opening Google Chrome Console +#### Google Chrome konsola giriş -You can open Google Chrome console either by clicking three dots at the top right corner of the browser, selecting _More tools -> Developer tools_ or using a keyboard shortcut. I prefer using shortcuts. +Siz Google Chrome konsolunu brauzerin yuxarı sağ küncündə üç nöqtəyə klikləməklə, _Əlavə alətlər -> Tərtibatçı alətləri_ seçməklə və ya klaviatura qısa yolundan istifadə etməklə aça bilərsiniz. Mən qısayollardan istifadə etməyi üstün tuturam. -![Opening chrome](images/opening_developer_tool.png) +![Brauzerə giriş](../images/opening_developer_tool.png) -To open the Chrome console using a keyboard shortcut. +Klaviatura qısayolu ilə brauzer açmaq üçün ```sh Mac @@ -175,16 +175,16 @@ Windows/Linux: Ctl+Shift+J ``` -![Opening console](images/opening_chrome_console_shortcut.png) +![Konsolu açmaq](../images/opening_chrome_console_shortcut.png) -After you open the Google Chrome console, try to explore the marked buttons. We will spend most of the time on the Console. The Console is the place where your JavaScript code goes. The Google Console V8 engine changes your JavaScript code to machine code. -Let us write a JavaScript code on the Google Chrome console: +Google Chrome konsolunu açdıqdan sonra işarələnmiş düymələri araşdırmağa çalışın. Biz vaxtımızın çox hissəsini Konsolda keçirəcəyik. Konsol JavaScript kodunuzun mövcud olduğu yerdir. Google Console V8 mühərriki JavaScript kodunuzu maşın koduna tərcümə edir. +Gəlin Google Chrome konsolunda JavaScript kodu yazaq: -![write code on console](./images/js_code_on_chrome_console.png) +![Konsolda kodun yazılması](../images/js_code_on_chrome_console.png) -#### Writing Code on Browser Console +#### Brauzer konsolunda kodun yazılması -We can write any JavaScript code on the Google console or any browser console. However, for this challenge, we only focus on Google Chrome console. Open the console using: +Biz istənilən JavaScript kodunu Google konsolunda və ya istənilən brauzer konsolunda yaza bilərik. Bununla belə, bu problem üçün biz yalnız Google Chrome konsoluna diqqət yetiririk. Konsolu aşağıdakılardan istifadə edərək açın: ```sh Mac @@ -196,17 +196,18 @@ Ctl+Shift+I ##### Console.log -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. +İlk JavaScript kodumuzu yazmaq üçün biz daxili funksiyadan istifadə etdik **console.log()**. Biz arqumenti giriş məlumatları kimi ötürdük və funksiya çıxışı göstərir. Biz console.log() funksiyasında giriş məlumatı və ya arqument kimi "Salam, Dünya"nı ötürdük. ```js -console.log('Hello, World!') +console.log('Salam, Dünya!') ``` -##### Console.log with Multiple Arguments +##### Console.log - birneçə arqument ilə -The **console.log()** function can take multiple parameters separated by commas. The syntax looks like as follows:**console.log(param1, param2, param3)** +**console.log()** funksiyasi vergüllə ayrılmış istənilən sayda parametri qəbul edə bilər. +Sintaksis: **console.log(param1, param2, param3)** -![console log multiple arguments](./images/console_log_multipl_arguments.png) +![console log - birneçə arqument ilə](../images/console_log_multipl_arguments.png) ```js console.log('Hello', 'World', '!') @@ -214,36 +215,35 @@ console.log('HAPPY', 'NEW', 'YEAR', 2020) console.log('Welcome', 'to', 30, 'Days', 'Of', 'JavaScript') ``` -As you can see from the snippet code above, _console.log()_ can take multiple arguments. +Yuxarıdakı kod parçasından göründüyü kimi, _console.log()_ çoxlu arqument qəbul edə bilər. -Congratulations! You wrote your first JavaScript code using _console.log()_. +Təbrik edirik! Siz ilk JavaScript kodunuzu _console.log()_ istifadə edərək yazdınız. -##### Comments +##### Şərhlər -We add comments to our code. Comments are very important to make code more readable and to leave remarks in our code. JavaScript does not execute the comment part of our code.In JavaScript, any text line starting with // in JavaScript is a comment, and anything enclosed like this /\* \*/ is also a comment. +Kodumuza şərhlər əlavə edirik. Kodu daha oxunaqlı etmək və kodumuzda qeydlər daxil etmək üçün şərhlər çox vacibdir. JavaScript kodumuzun şərh hissəsini qeydə almır və maşın dilinə tərcümə etmir. JavaScript-də // ilə başlayan hər hansı mətn sətiri şərhdir və həmçinin buna /\* \*/ kimi əlavə edilən hər şey də şərhdir. -**Example: Single Line Comment** +**Nümunə: Tək sətirli şərhlər** -// This is the first comment - // This is the second comment - // I am a single line comment +// Bu bir şərhdir + // Bu da bir şərhdir + // Bu da həmçinin -**Example: Multiline Comment** +**Nümunə: Çoxsətirli şərhlər** /* -This is a multiline comment - Multiline comments can take multiple lines - JavaScript is the language of the web +Çoxsətirli şərhlər + Çoxsətirli şərhlər bir neçə sətiri ehtiva edə bilir + JavaScript web-in dilidir */ -##### Syntax - -Programming languages are similar to human languages. English or many other language uses words, phrases, sentences,compound sentences and other more to convey a meaningful message. The English meaning of syntax is _the arrangement of words and phrases to create well-formed sentences in a language_. The technical definition of syntax is the structure of statements in a computer language.Programming languages have syntax. JavaScript is a programming language and like other programming languages it has its own syntax. If we do not write a syntax that JavaScript understands, it will raise different types of errors. We will explore different kinds of JavaScript errors later. For now, let us see syntax errors. +##### Sintaksis -![Error](images/raising_syntax_error.png) +Proqramlaşdırma dilləri insan dillərinə bənzəyir. İngilis və ya bir çox başqa dil mənalı mesajı çatdırmaq üçün sözlər, ifadələr, cümlələr, mürəkkəb cümlələr və sair istifadə edir. Sintaksisin ingiliscə mənası _dildə yaxşı formalaşmış cümlələr yaratmaq üçün söz və ifadələrin düzülüşüdür_. Sintaksisin texniki tərifi kompüter dilində ifadələrin strukturudur. Proqramlaşdırma dillərində sintaksis var. JavaScript proqramlaşdırma dilidir və digər proqramlaşdırma dilləri kimi onun da öz sintaksisi var. JavaScript-in başa düşdüyü sintaksisi yazmasaq, o, müxtəlif növ xətaları bizə qaytaracaq. Müxtəlif növ JavaScript xətalarını daha sonra araşdıracağıq. Hələlik gəlin sintaksis səhvlərinə baxaq. -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: +![Errorlar](../images/raising_syntax_error.png) +Mən qəsdən səhv etdim. Nəticədə, konsol sintaksis səhvlərini qaytarır. Əslində, sintaksis çox informativdir. Hansı növ səhvə yol verildiyini bildirir. Səhv rəyi təlimatını oxumaqla biz sintaksisi düzəldə və problemi həll edə bilərik. Proqramdakı xətaların müəyyən edilməsi və aradan qaldırılması prosesi "debugging" adlanır. Gəlin səhvləri düzəldək: ```js console.log('Hello, World!') console.log('Hello, World!') From 3f55ae7dd65857f60a7b9b855c2bc1ca202c46a0 Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 14:33:13 +0200 Subject: [PATCH 5/6] Fix all images path --- Azerbaijani/readMe.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Azerbaijani/readMe.md b/Azerbaijani/readMe.md index 1fdf15b..1f76e27 100644 --- a/Azerbaijani/readMe.md +++ b/Azerbaijani/readMe.md @@ -134,11 +134,11 @@ Mənbə: Github. İndi olmasa belə daha sonrakı addımlar üçün Node-a ehtiyaciniz var. Yükləmək üçün [buraya](https://nodejs.org/en/) istinad edin. -![Node Yüklənməsi](images/download_node.png) +![Node Yüklənməsi](../images/download_node.png) Yükləndikdən sonra quraşdırılma üçün -![Node quraşdırılması](images/install_node.png) +![Node quraşdırılması](../images/install_node.png) Əməliyyat sistemi terminalımızı açaraq maşınımızda node quraşdırılıb-quraşdırılmadığını yoxlaya bilərik. @@ -264,7 +264,7 @@ Now, let us practice more writing JavaScript codes using _console.log()_ on goog In addition to the text, we can also do mathematical calculations using JavaScript. Let us do the following simple calculations. The console can directly take arguments without the **_console.log()_** function. However, it is included in this introduction because most of this challenge would be taking place in a text editor where the usage of the function would be mandatory. You can play around directly with instructions on the console. -![Arithmetic](images/arithmetic.png) +![Arithmetic](../images/arithmetic.png) ```js console.log(2 + 3) // Addition @@ -283,7 +283,7 @@ We can write our codes on the browser console, but it won't do for bigger projec Visual studio code is a very popular open-source text editor. I would recommend to [download Visual Studio Code](https://code.visualstudio.com/), but if you are in favor of other editors, feel free to follow with what you have. -![Vscode](images/vscode.png) +![Vscode](../images/vscode.png) If you installed Visual Studio Code, let us start using it. @@ -291,19 +291,19 @@ If you installed Visual Studio Code, let us start using it. Open the Visual Studio Code by double-clicking its icon. When you open it, you will get this kind of interface. Try to interact with the labeled icons. -![Vscode ui](./images/vscode_ui.png) +![Vscode ui](../images/vscode_ui.png) -![Vscode add project](./images/adding_project_to_vscode.png) +![Vscode add project](../images/adding_project_to_vscode.png) -![Vscode open project](./images/opening_project_on_vscode.png) +![Vscode open project](../images/opening_project_on_vscode.png) -![script file](images/scripts_on_vscode.png) +![script file](../images/scripts_on_vscode.png) -![Installing Live Server](images/vsc_live_server.png) +![Installing Live Server](../images/vsc_live_server.png) ![running script](./images/running_script.png) -![coding running](./images/launched_on_new_tab.png) +![coding running](../images/launched_on_new_tab.png) ## Adding JavaScript to a Web Page @@ -371,7 +371,7 @@ This is how we write an internal script most of the time. Writing the JavaScript Open the browser console to see the output from the console.log() -![js code from vscode](./images/js_code_vscode.png) +![js code from vscode](../images/js_code_vscode.png) ### External Script @@ -437,7 +437,7 @@ console.log('Hello, World!') _Your main.js file should be below all other scripts_. It is very important to remember this. -![Multiple Script](./images/multiple_script.png) +![Multiple Script](../images/multiple_script.png) ## Introduction to Data types @@ -634,7 +634,7 @@ Asabeneh teacher Finland When you run _index.html_ file in the 01-Day folder you should get this: -![Day one](./images/day_1.png) +![Day one](../images/day_1.png) 🌕 You are amazing! You have just completed day 1 challenge and you are on your way to greatness. Now do some exercises for your brain and muscle. From 056718c2579f03b99549eba9c6e86af86c27fbbe Mon Sep 17 00:00:00 2001 From: Bakhtiyar-Garashov Date: Sun, 9 Jan 2022 23:29:09 +0200 Subject: [PATCH 6/6] First day translation finished --- Azerbaijani/01_Giriş/helloworld.js | 1 + Azerbaijani/01_Giriş/index.html | 19 ++ Azerbaijani/01_Giriş/introduction.js | 1 + Azerbaijani/01_Giriş/main.js | 4 + Azerbaijani/01_Giriş/variables.js | 20 ++ Azerbaijani/readMe.md | 293 +++++++++++++------------- 6 files changed, 191 insertions(+), 147 deletions(-) create mode 100644 Azerbaijani/01_Giriş/helloworld.js create mode 100644 Azerbaijani/01_Giriş/index.html create mode 100644 Azerbaijani/01_Giriş/introduction.js create mode 100644 Azerbaijani/01_Giriş/main.js create mode 100644 Azerbaijani/01_Giriş/variables.js diff --git a/Azerbaijani/01_Giriş/helloworld.js b/Azerbaijani/01_Giriş/helloworld.js new file mode 100644 index 0000000..6bfc5f3 --- /dev/null +++ b/Azerbaijani/01_Giriş/helloworld.js @@ -0,0 +1 @@ +console.log('Salam, dünya!') \ No newline at end of file diff --git a/Azerbaijani/01_Giriş/index.html b/Azerbaijani/01_Giriş/index.html new file mode 100644 index 0000000..776f724 --- /dev/null +++ b/Azerbaijani/01_Giriş/index.html @@ -0,0 +1,19 @@ + + + + + 30 Günlük JavaScript dərsləri + + + +

30 Günlük JavaScript:01 Gün

+

Giriş

+ + + + + + + + + \ No newline at end of file diff --git a/Azerbaijani/01_Giriş/introduction.js b/Azerbaijani/01_Giriş/introduction.js new file mode 100644 index 0000000..fa4212b --- /dev/null +++ b/Azerbaijani/01_Giriş/introduction.js @@ -0,0 +1 @@ +console.log('30 Günlük JS dərsləri') \ No newline at end of file diff --git a/Azerbaijani/01_Giriş/main.js b/Azerbaijani/01_Giriş/main.js new file mode 100644 index 0000000..c6a2e26 --- /dev/null +++ b/Azerbaijani/01_Giriş/main.js @@ -0,0 +1,4 @@ +// bir faylda müəyyən olunmuş dəyişənlər digərindən əlçatandır +console.log(firstName, lastName, country, city, age, isMarried) +console.log(gravity, boilingPoint, PI) // 9.81, 100, 3.14 +console.log(name, job, live) \ No newline at end of file diff --git a/Azerbaijani/01_Giriş/variables.js b/Azerbaijani/01_Giriş/variables.js new file mode 100644 index 0000000..2baee6a --- /dev/null +++ b/Azerbaijani/01_Giriş/variables.js @@ -0,0 +1,20 @@ +// Müxtəlif verilənlər tipindən istifadə edərək dəyişənlərin yaradılmasə + +let firstName = 'Asabeneh' // ad +let lastName = 'Yetayeh' // soyad +let country = 'Finland' // ölkə +let city = 'Helsinki' // paytaxt +let age = 100 // yaş +let isMarried = true + +// ədəd tipli dəyişənlərin sabit açar sözü ilə yaradılması + +const gravity = 9.81 // Fizikada istifadə olunan qravitasiya sabiti +const boilingPoint = 100 // Normal atmosfer təzyiqində suyun qaynama tempraturu +const PI = 3.14 // Geometrik sabit + +// Yalnız bir açar sözü istifadə etməklə müxtəlif dəyişənlər vergüllə ayrılmış şəkildə yaradıla bilər + +let name = 'Asabeneh', //ad + job = 'teacher', // vəzifə + live = 'Finland' // ölkə diff --git a/Azerbaijani/readMe.md b/Azerbaijani/readMe.md index 1f76e27..e00a2ae 100644 --- a/Azerbaijani/readMe.md +++ b/Azerbaijani/readMe.md @@ -249,8 +249,9 @@ 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 quotes. -**Example:** +İndiyə qədər biz _console.log()_ istifadə edərək mətnin necə göstərildiyini gördük. Əgər biz _console.log()_ istifadə edərək mətni və ya sətri çap ediriksə, mətn tək dırnaqlar, qoşa dırnaqlar və ya əks dırnaqlar (backtick) içərisində olmalıdır. + +**Nümunə:** ```js console.log('Hello, World!') @@ -258,204 +259,206 @@ console.log("Hello, World!") console.log(`Hello, World!`) ``` -#### Arithmetics +#### Riyazi əməliyyatlar + +İndi gəlin ədəd tipli dəyişənlər üzərində Google Chrome konsolunda _console.log()_ istifadə edərək JavaScript kodlarının yazılmasına aid nümunələri məşq edək. -Now, let us practice more writing JavaScript codes using _console.log()_ on google chrome console for number data types. -In addition to the text, we can also do mathematical calculations using JavaScript. Let us do the following simple calculations. -The console can directly take arguments without the **_console.log()_** function. However, it is included in this introduction because most of this challenge would be taking place in a text editor where the usage of the function would be mandatory. You can play around directly with instructions on the console. +Mətnə əlavə olaraq JavaScript-dən istifadə edərək riyazi hesablamalar da edə bilərik. Aşağıdakı sadə hesablamaları aparaq. +Konsol **_console.log()_** funksiyası olmadan birbaşa arqumentlər qəbul edə bilər. Bununla belə, o, dərslikdə daha əvvəldə daxil edilmişdir, çünki bu nümunələrin əksəriyyəti funksiyadan istifadənin məcburi olduğu mətn redaktorunda baş verəcəkdir. Konsoldakı təlimatlarlı birbaşa nəzərdən keçirə bilərsiniz. -![Arithmetic](../images/arithmetic.png) +![Riyazi hesablamalar](../images/arithmetic.png) ```js -console.log(2 + 3) // Addition -console.log(3 - 2) // Subtraction -console.log(2 * 3) // Multiplication -console.log(3 / 2) // Division -console.log(3 % 2) // Modulus - finding remainder -console.log(3 ** 2) // Exponentiation 3 ** 2 == 3 * 3 +console.log(2 + 3) // Toplama +console.log(3 - 2) // Çıxma +console.log(2 * 3) // Vurma +console.log(3 / 2) // Bölmə +console.log(3 % 2) // Qalığın tapılması +console.log(3 ** 2) // Qüvvət üstü. Yəni, 3 ** 2 == 3 * 3 ``` -### Code Editor +### Mətn redaktoru -We can write our codes on the browser console, but it won't do for bigger projects. In a real working environment, developers use different code editors to write their codes. In this 30 days JavaScript challenge, we will be using Visual Studio Code. +Kodlarımızı brauzer konsoluna yaza bilərik, lakin bu, daha böyük layihələr üçün əlverişli deyil və ya bəzi hallarda mümkünsüzdür. Real iş mühitində proqramçılar kodlarını yazmaq üçün müxtəlif kod/mətn redaktorlarından istifadə edirlər. Bu 30 günlük JavaScript dərsliyində biz Visual Studio Code-dan istifadə edəcəyik. -#### Installing Visual Studio Code +#### Visual Studio Code-un yüklənməsi -Visual studio code is a very popular open-source text editor. I would recommend to [download Visual Studio Code](https://code.visualstudio.com/), but if you are in favor of other editors, feel free to follow with what you have. +Visual Studio Code çox məşhur açıq mənbəli mətn redaktorudur. [Visual Studio Code-u yükləmə](https://code.visualstudio.com/) tövsiyə edərdim, lakin başqa redaktorların tərəfdarısınızsa, əlinizdə olanları istifadə etməkdən çəkinməyin. ![Vscode](../images/vscode.png) -If you installed Visual Studio Code, let us start using it. +Yüklədikdən sonra mətn redaktoru artıq istifadəyə hazırdır. -#### How to Use Visual Studio Code +#### Visual Studio Code-u necə istifadə etməli -Open the Visual Studio Code by double-clicking its icon. When you open it, you will get this kind of interface. Try to interact with the labeled icons. +Yüklənmə uğurla başa çatdıqdan sonra Visual Studio Code ikonuna 2 ardıcıl klik edərək onu başlada bilərsiniz -![Vscode ui](../images/vscode_ui.png) +![Vscode istifadəçi interfeysi](../images/vscode_ui.png) -![Vscode add project](../images/adding_project_to_vscode.png) +![Vscode-da proyekt əlavə etmək](../images/adding_project_to_vscode.png) -![Vscode open project](../images/opening_project_on_vscode.png) +![Vscode-da mövcud proyekti açmaq](../images/opening_project_on_vscode.png) -![script file](../images/scripts_on_vscode.png) +![Skript faylı](../images/scripts_on_vscode.png) -![Installing Live Server](../images/vsc_live_server.png) +![Live Server əlavəsinin yüklənilməsi](../images/vsc_live_server.png) -![running script](./images/running_script.png) +![Skriptin icrası](./images/running_script.png) -![coding running](../images/launched_on_new_tab.png) +![Kodun icrası](../images/launched_on_new_tab.png) -## Adding JavaScript to a Web Page +## Veb səhifəyə JavaScript əlavə olunması -JavaScript can be added to a web page in three different ways: +JavaScript kodu veb səhifəyə 3 üsulla əlavə edilə bilər: -- **_Inline script_** -- **_Internal script_** -- **_External script_** -- **_Multiple External scripts_** +- **_Sətirdaxili skript_** +- **_Daxili skript_** +- **_Xarici fayl ilə skript_** +- **_Birneçə xarici faylla skript_** -The following sections show different ways of adding JavaScript code to your web page. +Aşağıdakı bölmələr veb səhifənizə JavaScript kodu əlavə etməyin müxtəlif yollarını göstərir. -### Inline Script +### Sətirdaxili skript -Create a project folder on your desktop or in any location, name it 30DaysOfJS and create an **_index.html_** file in the project folder. Then paste the following code and open it in a browser, for example [Chrome](https://www.google.com/chrome/). +İş masanızda və ya istənilən yerdə layihə qovluğu yaradın, onu 30DaysOfJS adlandırın və layihə qovluğunda **_index.html_** faylı yaradın. Sonra aşağıdakı kodu fayla əlavə edib onu brauzerdə açın, məsələn [Chrome](https://www.google.com/chrome/) ilə. ```html - 30DaysOfScript:Inline Script + 30DaysOfScript: Sətirdaxili skript - + ``` -Now, you just wrote your first inline script. We can create a pop up alert message using the _alert()_ built-in function. +İndi siz ilk daxili skriptinizi yazdınız. Biz _alert()_ daxili funksiyasından istifadə edərək pop-up xəbərdarlıq mesajı yarada bilərik. -### Internal Script +### Daxili skript -The internal script can be written in the _head_ or the _body_, but it is preferred to put it on the body of the HTML document. -First, let us write on the head part of the page. +Daxili skript _head_ və ya _body_ ilə yazıla bilər, lakin onu HTML sənədinin gövdəsinə yerləşdirməyə üstünlük verilir. +Əvvəlcə səhifənin baş hissəsinə yazaq. ```html - 30DaysOfScript:Internal Script + 30DaysOfScript: Daxili skript ``` -This is how we write an internal script most of the time. Writing the JavaScript code in the body section is the most preferred option. Open the browser console to see the output from the console.log() +Çox vaxt daxili skripti belə yazırıq. JavaScript kodunun faylın gövdəsinə (body) bölməsinə yazılması ən çox üstünlük verilən seçimdir. console.log() saytından çıxışı görmək üçün brauzer konsolunu açın ```html - 30DaysOfScript:Internal Script + 30DaysOfScript: Daxili skript - + ``` -Open the browser console to see the output from the console.log() +console.log() saytından çıxışı görmək üçün brauzer konsolunu açın -![js code from vscode](../images/js_code_vscode.png) +![JS kodu redaktorda](../images/js_code_vscode.png) -### External Script +### Xarici kod skripti -Similar to the internal script, the external script link can be on the header or body, but it is preferred to put it in 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. +Daxili skriptə bənzər şəkildə, xarici skript bağlantısı başlıqda (head) və ya gövdədə (body) ola bilər, lakin onun gövdəyə yerləşdirilməsinə üstünlük verilir. +Əvvəlcə .js uzantılı xarici JavaScript faylı yaratmalıyıq. .js uzantısı ilə bitən bütün fayllar JavaScript fayllarıdır. Layihə qovluğunda introduction.js adlı fayl yaradın və aşağıdakı kodu yazın və bu .js faylını gövdənin aşağı hissəsində əlaqələndirin. ```js -console.log('Welcome to 30DaysOfJavaScript') +console.log('30 Günlük JS dərsləri') ``` -External scripts in the _head_: +_head_ hissəsində JavaScript faylına istinad: ```html - 30DaysOfJavaScript:External script + 30DaysOfJavaScript: Xarici skript faylı ``` -External scripts in the _body_: +_body_ hissəsində JavaScript faylına istinad: ```html - 30DaysOfJavaScript:External script + 30DaysOfJavaScript: Xarici skript faylı - - + + ``` -Open the browser console to see the output of the console.log() +console.log() nəticəsini görmək üçün brauzer konsolunu açın. -### Multiple External Scripts +### Birneçə xarici skript faylına istinad -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. +Biz həmçinin bir neçə xarici JavaScript faylına veb səhifədə istinad edə bilərik. +30DaysOfJS qovluğunda helloworld.js faylı yaradın və aşağıdakı kodu yazın. ```js -console.log('Hello, World!') +console.log('Salam, dünya!') ``` ```html - Multiple External Scripts + Birneçə xarici skript faylına istinad - - + + ``` -_Your main.js file should be below all other scripts_. It is very important to remember this. +_Main.js_ faylınız bütün digər skriptlərdən sonra daxil edilməlidir. Bunu xatırlamaq çox vacibdir. -![Multiple Script](../images/multiple_script.png) +![Birneçə fayl](../images/multiple_script.png) -## Introduction to Data types +## Verilənlər tiplərinə giriş -In JavaScript and also other programming languages, there are different kinds of data types. The following are JavaScript primitive data types:_String, Number, Boolean, undefined, Null_, and _Symbol_. +JavaScript-də və digər proqramlaşdırma dillərində müxtəlif növ məlumat növləri mövcuddur. Aşağıdakılar JavaScript primitiv verilən tipləridir:_String, Number, Boolean, undefined, Null_ və _Symbol_. -### Numbers +### Ədədlər (Numbers) -- Integers: Integer (negative, zero and positive) numbers - Example: +- İnteger: Integer (mənfi, sıfır və müsbət) ədədlər + Nümunə: ... -3, -2, -1, 0, 1, 2, 3 ... -- Float-point numbers: Decimal number - Example +- Tam hissəli ədədlər: Onluq (Decimal) ədədlər + Nümunə: ... -3.5, -2.25, -1.0, 0.0, 1.1, 2.2, 3.5 ... -### Strings +### Sətir (String) tipli verilənlər -A collection of one or more characters between two single quotes, double quotes, or backticks. -**Example:** +İki tək dırnaq, qoşa dırnaq və ya əks istiqamətli dırnaqlar arasında bir və ya daha çox simvol çoxluğudur. + +**Nümunə:** ```js 'Asabeneh' @@ -467,39 +470,37 @@ A collection of one or more characters between two single quotes, double quotes, 'A string could be just as small as one character as big as many pages' ``` -### Booleans - -A boolean value is either True or False. Any comparisons returns a boolean value, which is either true or false. +### Məntiqi ifadələr -A boolean data type is either a true or false value. +Məntiqi tiplər yalnız iki mümkün qiymətdən birini ala bilən ifadələrdir. İstənilən müqayisə əməliyyatı _true_ və ya _false_ qiymətlərinin birindən ibarət nəticə qaytarır. -**Example:** +**Nümunə:** ```js -true // if the light is on, the value is true -false // if the light is off, the value is false +true +false ``` ### 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. +JavaScript-də dəyişənə ilkin qiymət təyin etməsək, _undefined_ tipi verilir. Bundan əlavə, funksiya heç nə qaytarmırsa, susmaya görə _undefined_ qaytarır. ```js let firstName -console.log(firstName) // undefined, because it is not assigned to a value yet +console.log(firstName) // undefined, çünki dəyişənə ilkin qiymət təyin edilməyib ``` ### Null -Null in JavaScript means an empty value. +JavaScript-də null boş dəyər deməkdir. ```js let emptyValue = null ``` -## Checking Data Types +## Verilənlər tiplərinin yoxlanılması -To check the data type of a certain variable, we use the **typeof** operator. See the following example. +Hər hansi müəyyən olunmuş dəyişənin tipini tapmaq üçün **typeof** operatoru istifadə oluna bilər. Nümunəyə nəzər yetirin. ```js console.log(typeof 'Asabeneh') // string @@ -509,21 +510,20 @@ console.log(typeof null) // object type console.log(typeof undefined) // undefined ``` -## Comments Again +## Şərhlər (daha artıq) -Remember that commenting in JavaScript is similar to other programming languages. Comments are important in making your code more readable. -There are two ways of commenting: +Bildiyimiz kimi JavaScript-də şərh yazmaq digər proqramlaşdırma dillərinə olduğu kimidir. Kodunuzu daha oxunaqlı etmək üçün şərhlər vacibdir. +Şərh əlavə etməyin iki yolu var: -- _Single line commenting_ -- _Multiline commenting_ +- _Təksətirli şərhlər_ +- _Çoxsətirli şərhlər_ ```js -// commenting the code itself with a single comment -// let firstName = 'Asabeneh'; single line comment -// let lastName = 'Yetayeh'; single line comment +// let firstName = 'Asabeneh'; tək sətirli şərh +// let lastName = 'Yetayeh'; tək sətirli şərh ``` -Multiline commenting: +Çoxsətirli şərhlər: ```js /* @@ -535,20 +535,20 @@ Multiline commenting: */ ``` -## Variables +## Dəyişıənlər -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. +Dəyişənlər məlumatların yaddaşda saxlanması üçün istifadə olunur. Dəyişən elan edildikdə, yaddaş yeri rezerv olunur. Dəyişən təyin edildikdə, yaddaş sahəsində həmin verilənlər saxlanılır. Dəyişən elan etmək üçün biz _var_, _let_ və ya _const_ açar sözlərindən istifadə edirik. -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. +Qİyməti proqram daxilində dəyişən dəyişənlər üçün biz _let_ istifadə edirik. Məlumatlar ümumiyyətlə dəyişməzsə, yəni sabitlər üçün biz _const_ istifadə edirik. Məsələn, PI sabiti üçün biz _const_ istifadə edə bilərik. Bu dərslikdə _var_ istifadə etməyəcəyik və mən sizə ondan istifadə etməyi tövsiyə etmirəm. Bu, tövsiyə edilən yol deyil və təhlükəli məqamlara yol aça bilər. Var, let və const haqqında digər bölmələrdə ətraflı danışacağıq. Hələlik yuxarıdakı izahat kifayətdir. -A valid JavaScript variable name must follow the following rules: +Düzgün JavaScript dəyişən adı aşağıdakı qaydalara əməl etməlidir: -- A JavaScript variable name should not begin with a number. -- A JavaScript variable name does not allow special characters except dollar sign and underscore. -- A JavaScript variable name follows a camelCase convention. -- A JavaScript variable name should not have space between words. +- Rəqəmlə başlaya bilməz. +- $ və _ istisna olmaqla xüsusi simvolların istifadəsinə icazə verilmir. +- Adətən camelCase konvensiyasına əsaslanaraq adlandırılır. +- Sözlər və ya dəyişən adının hissələri arasında boşluq olmaz. -The following are examples of valid JavaScript variables. +Düzgün dəyişən adları nümunələri: ```js firstName @@ -572,9 +572,9 @@ year2020 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. +Siyahıdakı birinci və ikinci dəyişənlər JavaScript-də elan etmək üçün camelCase konvensiyasına uyğundur. Bu dərslikdə biz camelCase dəyişənlərindən istifadə edəcəyik. -Example of invalid variables: +Yalnış elan olunmuş dəyişənlər: ```sh first-name @@ -582,22 +582,22 @@ Example of invalid variables: num_#_1 ``` -Let us declare variables with different data types. To declare a variable, we need to use _let_ or _const_ keyword before the variable name. Following the variable name, we write an equal sign (assignment operator), and a value(assigned data). +Müxtəlif verilən tipləri ilə dəyişənləri elan edək. Dəyişən elan etmək üçün dəyişən adından əvvəl _let_ və ya _const_ açar sözündən istifadə etməliyik. Dəyişən adından sonra bərabər işarəsi (təyinat operatoru) və dəyəri (təyin edilmiş verilənlər) yazırıq. ```js -// Syntax +// Sintaksis let nameOfVariable = value ``` -**Examples of declared variables** +**Nümunələr** ```js -// Declaring different variables of different data types -let firstName = 'Asabeneh' // first name of a person -let lastName = 'Yetayeh' // last name of a person -let country = 'Finland' // country -let city = 'Helsinki' // capital city -let age = 100 // age in years +// Müxtəlif verilənlər tipindən istifadə edərək dəyişənlərin yaradılmasə +let firstName = 'Asabeneh' // ad +let lastName = 'Yetayeh' // soyad +let country = 'Finland' // ölkə +let city = 'Helsinki' // paytaxt +let age = 100 // yaş let isMarried = true console.log(firstName, lastName, country, city, age, isMarried) @@ -608,11 +608,11 @@ Asabeneh Yetayeh Finland Helsinki 100 true ``` ```js -// Declaring variables with number values -let age = 100 // age in years -const gravity = 9.81 // earth gravity in m/s2 -const boilingPoint = 100 // water boiling point, temperature in °C -const PI = 3.14 // geometrical constant +// ədəd tipli dəyişənlərin sabit açar sözü ilə yaradılması +let age = 100 // yaş +const gravity = 9.81 // Fizikada istifadə olunan qravitasiya sabiti +const boilingPoint = 100 // Normal atmosfer təzyiqində suyun qaynama tempraturu +const PI = 3.14 // Geometrik sabit console.log(gravity, boilingPoint, PI) ``` @@ -621,10 +621,10 @@ console.log(gravity, boilingPoint, PI) ``` ```js -// Variables can also be declaring in one line separated by comma -let name = 'Asabeneh', // name of a person -job = 'teacher', -live = 'Finland' +// Yalnız bir açar sözü istifadə etməklə müxtəlif dəyişənlər vergüllə ayrılmış şəkildə yaradıla bilər +let name = 'Asabeneh', //ad + job = 'teacher', // vəzifə + live = 'Finland' // ölkə console.log(name, job, live) ``` @@ -632,32 +632,31 @@ console.log(name, job, live) Asabeneh teacher Finland ``` -When you run _index.html_ file in the 01-Day folder you should get this: +01_Giriş qovluqda _index.html_ faylını işə saldığınız zaman bunu əldə etməlisiniz: -![Day one](../images/day_1.png) +![Gün 1](../images/day_1.png) -🌕 You are amazing! You have just completed day 1 challenge and you are on your way to greatness. Now do some exercises for your brain and muscle. +🌕 Təbrik edirik! Siz 1-ci günü yenicə tamamladınız. İndi beyniniz və əzələniz üçün bəzi fiziki hərəkətlər edin. -# 💻 Day 1: Exercises +# 💻 Gün 1: Tapşırıqlar -1. Write a single line comment which says, _comments can make code readable_ -2. Write another single comment which says, _Welcome to 30DaysOfJavaScript_ -3. Write a multiline comment which says, _comments can make code readable, easy to reuse_ - _and informative_ +1. _şərhlər kodu oxunaqlı edə bilər_ mətnini özündə ehtiva edən tək sətirli şərh yazın. +2. _30DaysOfJavaScript-ə xoş gəlmisiniz_ deyən başqa bir şərh yazın. +3. Şərhlərin kodu oxunaqlı, təkrar istifadəsi asan və məlumatlandırıcı edə biləcəyini deyən çoxsətirli şərh yazın -4. Create a variable.js file and declare variables and assign string, boolean, undefined and null data types -5. Create datatypes.js file and use the JavaScript **_typeof_** operator to check different data types. Check the data type of each variable -6. Declare four variables without assigning values -7. Declare four variables with assigned values -8. Declare variables to store your first name, last name, marital status, country and age in multiple lines -9. Declare variables to store your first name, last name, marital status, country and age in a single line -10. Declare two variables _myAge_ and _yourAge_ and assign them initial values and log to the browser console. +4. Variables.js faylı yaradın və dəyişənləri elan edin və sətir, boolean, undefined və null dəyişən tiplərini təyin edin +5. datatypes.js faylı yaradın və müxtəlif dəyişən tiplərini yoxlamaq üçün JavaScript **_typeof_** operatorundan istifadə edin. +6. İlkin qiymət təyin etmədən dörd dəyişəni elan edin +7. Təyin edilmiş ilkin qiymət olan dörd dəyişəni elan edin +8. Adınızı, soyadınızı, ailə vəziyyətinizi, ölkənizi və yaşınızı bir neçə sətirdə saxlamaq üçün dəyişənləri elan edin +9. Adınızı, soyadınızı, ailə vəziyyətinizi, ölkənizi və yaşınızı bir sətirdə saxlamaq üçün dəyişənləri elan edin +10. İki _myAge_ və _yourAge_ dəyişənini elan edin və onlara ilkin qiymətlər təyin edin və brauzer konsoluna daxil olun. ```sh I am 25 years old. You are 30 years old. ``` -🎉 CONGRATULATIONS ! 🎉 +🎉 TƏBRİK EDİRİK ! 🎉 -[Day 2 >>](./02_Day_Data_types/02_day_data_types.md) +[Gün 2 >>](./02_Day_Data_types/02_day_data_types.md)