From 3aac652f9af5621da0b784969ca1acff455d22a8 Mon Sep 17 00:00:00 2001 From: Ownertest21 <126245359+Ownertest21@users.noreply.github.com> Date: Fri, 24 Feb 2023 17:20:40 +0530 Subject: [PATCH] Add files via upload --- countries - Copy.js | 195 +++++++++++++++++++++++++++++++++ countries.js | 195 +++++++++++++++++++++++++++++++++ helloworld - Copy.js | 1 + helloworld.js | 1 + includes - Copy.js | 14 +++ includes.js | 14 +++ introduction - Copy.js | 1 + introduction.js | 1 + main - Copy.js | 4 + main.js | 4 + math_object - Copy.js | 34 ++++++ math_object.js | 34 ++++++ string_concatenation - Copy.js | 19 ++++ string_concatenation.js | 19 ++++ substr - Copy.js | 5 + substr.js | 5 + trim - Copy.js | 7 ++ trim.js | 7 ++ 18 files changed, 560 insertions(+) create mode 100644 countries - Copy.js create mode 100644 countries.js create mode 100644 helloworld - Copy.js create mode 100644 helloworld.js create mode 100644 includes - Copy.js create mode 100644 includes.js create mode 100644 introduction - Copy.js create mode 100644 introduction.js create mode 100644 main - Copy.js create mode 100644 main.js create mode 100644 math_object - Copy.js create mode 100644 math_object.js create mode 100644 string_concatenation - Copy.js create mode 100644 string_concatenation.js create mode 100644 substr - Copy.js create mode 100644 substr.js create mode 100644 trim - Copy.js create mode 100644 trim.js diff --git a/countries - Copy.js b/countries - Copy.js new file mode 100644 index 00000000..e57b0050 --- /dev/null +++ b/countries - Copy.js @@ -0,0 +1,195 @@ +const countries = [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'Andorra', + 'Angola', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bhutan', + 'Bolivia', + 'Bosnia and Herzegovina', + 'Botswana', + 'Brazil', + 'Brunei', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Colombi', + 'Comoros', + 'Congo (Brazzaville)', + 'Congo', + 'Costa Rica', + "Cote d'Ivoire", + 'Croatia', + 'Cuba', + 'Cyprus', + 'Czech Republic', + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'East Timor (Timor Timur)', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Fiji', + 'Finland', + 'France', + 'Gabon', + 'Gambia, The', + 'Georgia', + 'Germany', + 'Ghana', + 'Greece', + 'Grenada', + 'Guatemala', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Honduras', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran', + 'Iraq', + 'Ireland', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + 'Korea, North', + 'Korea, South', + 'Kuwait', + 'Kyrgyzstan', + 'Laos', + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macedonia', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Mauritania', + 'Mauritius', + 'Mexico', + 'Micronesia', + 'Moldova', + 'Monaco', + 'Mongolia', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Poland', + 'Portugal', + 'Qatar', + 'Romania', + 'Russia', + 'Rwanda', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Vincent', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia and Montenegro', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syria', + 'Taiwan', + 'Tajikistan', + 'Tanzania', + 'Thailand', + 'Togo', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Vatican City', + 'Venezuela', + 'Vietnam', + 'Yemen', + 'Zambia', + 'Zimbabwe' +] diff --git a/countries.js b/countries.js new file mode 100644 index 00000000..e57b0050 --- /dev/null +++ b/countries.js @@ -0,0 +1,195 @@ +const countries = [ + 'Afghanistan', + 'Albania', + 'Algeria', + 'Andorra', + 'Angola', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bhutan', + 'Bolivia', + 'Bosnia and Herzegovina', + 'Botswana', + 'Brazil', + 'Brunei', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Colombi', + 'Comoros', + 'Congo (Brazzaville)', + 'Congo', + 'Costa Rica', + "Cote d'Ivoire", + 'Croatia', + 'Cuba', + 'Cyprus', + 'Czech Republic', + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'East Timor (Timor Timur)', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Fiji', + 'Finland', + 'France', + 'Gabon', + 'Gambia, The', + 'Georgia', + 'Germany', + 'Ghana', + 'Greece', + 'Grenada', + 'Guatemala', + 'Guinea', + 'Guinea-Bissau', + 'Guyana', + 'Haiti', + 'Honduras', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran', + 'Iraq', + 'Ireland', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + 'Korea, North', + 'Korea, South', + 'Kuwait', + 'Kyrgyzstan', + 'Laos', + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macedonia', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Mauritania', + 'Mauritius', + 'Mexico', + 'Micronesia', + 'Moldova', + 'Monaco', + 'Mongolia', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Poland', + 'Portugal', + 'Qatar', + 'Romania', + 'Russia', + 'Rwanda', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Vincent', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia and Montenegro', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syria', + 'Taiwan', + 'Tajikistan', + 'Tanzania', + 'Thailand', + 'Togo', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Vatican City', + 'Venezuela', + 'Vietnam', + 'Yemen', + 'Zambia', + 'Zimbabwe' +] diff --git a/helloworld - Copy.js b/helloworld - Copy.js new file mode 100644 index 00000000..8c9e2c0a --- /dev/null +++ b/helloworld - Copy.js @@ -0,0 +1 @@ +console.log('Hello, World!') \ No newline at end of file diff --git a/helloworld.js b/helloworld.js new file mode 100644 index 00000000..8c9e2c0a --- /dev/null +++ b/helloworld.js @@ -0,0 +1 @@ +console.log('Hello, World!') \ No newline at end of file diff --git a/includes - Copy.js b/includes - Copy.js new file mode 100644 index 00000000..3fbe8e06 --- /dev/null +++ b/includes - Copy.js @@ -0,0 +1,14 @@ +// includes(): It takes a substring argument and it check if substring argument exists in the string. includes() returns a boolean. It checks if a substring exist in a string and it returns true if it exists and false if it doesn't exist. +let string = '30 Days Of JavaScript' +console.log(string.includes('Days')) // true +console.log(string.includes('days')) // false +console.log(string.includes('Script')) // true +console.log(string.includes('script')) // false +console.log(string.includes('java')) // false +console.log(string.includes('Java')) // true + +let country = 'Finland' +console.log(country.includes('fin')) // false +console.log(country.includes('Fin')) // true +console.log(country.includes('land')) // true +console.log(country.includes('Land')) // false \ No newline at end of file diff --git a/includes.js b/includes.js new file mode 100644 index 00000000..3fbe8e06 --- /dev/null +++ b/includes.js @@ -0,0 +1,14 @@ +// includes(): It takes a substring argument and it check if substring argument exists in the string. includes() returns a boolean. It checks if a substring exist in a string and it returns true if it exists and false if it doesn't exist. +let string = '30 Days Of JavaScript' +console.log(string.includes('Days')) // true +console.log(string.includes('days')) // false +console.log(string.includes('Script')) // true +console.log(string.includes('script')) // false +console.log(string.includes('java')) // false +console.log(string.includes('Java')) // true + +let country = 'Finland' +console.log(country.includes('fin')) // false +console.log(country.includes('Fin')) // true +console.log(country.includes('land')) // true +console.log(country.includes('Land')) // false \ No newline at end of file diff --git a/introduction - Copy.js b/introduction - Copy.js new file mode 100644 index 00000000..fa4212bd --- /dev/null +++ b/introduction - Copy.js @@ -0,0 +1 @@ +console.log('30 Günlük JS dərsləri') \ No newline at end of file diff --git a/introduction.js b/introduction.js new file mode 100644 index 00000000..fa4212bd --- /dev/null +++ b/introduction.js @@ -0,0 +1 @@ +console.log('30 Günlük JS dərsləri') \ No newline at end of file diff --git a/main - Copy.js b/main - Copy.js new file mode 100644 index 00000000..c6a2e26e --- /dev/null +++ b/main - Copy.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/main.js b/main.js new file mode 100644 index 00000000..c6a2e26e --- /dev/null +++ b/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/math_object - Copy.js b/math_object - Copy.js new file mode 100644 index 00000000..784b2ae8 --- /dev/null +++ b/math_object - Copy.js @@ -0,0 +1,34 @@ +const PI = Math.PI +console.log(PI) // 3.141592653589793 +console.log(Math.round(PI)) // 3; to round values to the nearest number +console.log(Math.round(9.81)) // 10 +console.log(Math.floor(PI)) // 3; rounding down +console.log(Math.ceil(PI)) // 4; rounding up +console.log(Math.min(-5, 3, 20, 4, 5, 10)) // -5, returns the minimum value +console.log(Math.max(-5, 3, 20, 4, 5, 10)) // 20, returns the maximum value + +const randNum = Math.random() // creates random number between 0 to 0.999999 +console.log(randNum) +// Let create random number between 0 to 10 +const num = Math.floor(Math.random() * 11) // creates random number between 0 and 10 +console.log(num) + +//Absolute value +console.log(Math.abs(-10)) //10 +//Square root +console.log(Math.sqrt(100)) // 10 +console.log(Math.sqrt(2)) //1.4142135623730951 +// Power +console.log(Math.pow(3, 2)) // 9 +console.log(Math.E) // 2.718 + +// Logarithm +//Returns the natural logarithm of base E of x, Math.log(x) +console.log(Math.log(2)) // 0.6931471805599453 +console.log(Math.log(10)) // 2.302585092994046 + +// Trigonometry +console.log(Math.sin(0)) +console.log(Math.sin(60)) +console.log(Math.cos(0)) +console.log(Math.cos(60)) diff --git a/math_object.js b/math_object.js new file mode 100644 index 00000000..784b2ae8 --- /dev/null +++ b/math_object.js @@ -0,0 +1,34 @@ +const PI = Math.PI +console.log(PI) // 3.141592653589793 +console.log(Math.round(PI)) // 3; to round values to the nearest number +console.log(Math.round(9.81)) // 10 +console.log(Math.floor(PI)) // 3; rounding down +console.log(Math.ceil(PI)) // 4; rounding up +console.log(Math.min(-5, 3, 20, 4, 5, 10)) // -5, returns the minimum value +console.log(Math.max(-5, 3, 20, 4, 5, 10)) // 20, returns the maximum value + +const randNum = Math.random() // creates random number between 0 to 0.999999 +console.log(randNum) +// Let create random number between 0 to 10 +const num = Math.floor(Math.random() * 11) // creates random number between 0 and 10 +console.log(num) + +//Absolute value +console.log(Math.abs(-10)) //10 +//Square root +console.log(Math.sqrt(100)) // 10 +console.log(Math.sqrt(2)) //1.4142135623730951 +// Power +console.log(Math.pow(3, 2)) // 9 +console.log(Math.E) // 2.718 + +// Logarithm +//Returns the natural logarithm of base E of x, Math.log(x) +console.log(Math.log(2)) // 0.6931471805599453 +console.log(Math.log(10)) // 2.302585092994046 + +// Trigonometry +console.log(Math.sin(0)) +console.log(Math.sin(60)) +console.log(Math.cos(0)) +console.log(Math.cos(60)) diff --git a/string_concatenation - Copy.js b/string_concatenation - Copy.js new file mode 100644 index 00000000..516ca1a9 --- /dev/null +++ b/string_concatenation - Copy.js @@ -0,0 +1,19 @@ +// Declaring different variables of different data types +let space = ' ' +let firstName = 'Asabeneh' +let lastName = 'Yetayeh' +let country = 'Finland' +let city = 'Helsinki' +let language = 'JavaScript' +let job = 'teacher' +// Concatenating using addition operator +let fullName = firstName + space + lastName // concatenation, merging two string together. +console.log(fullName) + +let personInfoOne = fullName + '. I am ' + age + '. I live in ' + country // ES5 +console.log(personInfoOne) +// Concatenation: Template Literals(Template Strings) +let personInfoTwo = `I am ${fullName}. I am ${age}. I live in ${country}.` //ES6 - String interpolation method +let personInfoThree = `I am ${fullName}. I live in ${city}, ${country}. I am a ${job}. I teach ${language}.` +console.log(personInfoTwo) +console.log(personInfoThree) \ No newline at end of file diff --git a/string_concatenation.js b/string_concatenation.js new file mode 100644 index 00000000..516ca1a9 --- /dev/null +++ b/string_concatenation.js @@ -0,0 +1,19 @@ +// Declaring different variables of different data types +let space = ' ' +let firstName = 'Asabeneh' +let lastName = 'Yetayeh' +let country = 'Finland' +let city = 'Helsinki' +let language = 'JavaScript' +let job = 'teacher' +// Concatenating using addition operator +let fullName = firstName + space + lastName // concatenation, merging two string together. +console.log(fullName) + +let personInfoOne = fullName + '. I am ' + age + '. I live in ' + country // ES5 +console.log(personInfoOne) +// Concatenation: Template Literals(Template Strings) +let personInfoTwo = `I am ${fullName}. I am ${age}. I live in ${country}.` //ES6 - String interpolation method +let personInfoThree = `I am ${fullName}. I live in ${city}, ${country}. I am a ${job}. I teach ${language}.` +console.log(personInfoTwo) +console.log(personInfoThree) \ No newline at end of file diff --git a/substr - Copy.js b/substr - Copy.js new file mode 100644 index 00000000..0bea56d5 --- /dev/null +++ b/substr - Copy.js @@ -0,0 +1,5 @@ +//substr(): It takes two arguments,the starting index and number of characters to slice. +let string = 'JavaScript' +console.log(string.substr(4,6)) // Script +let country = 'Finland' +console.log(country.substr(3, 4)) // land \ No newline at end of file diff --git a/substr.js b/substr.js new file mode 100644 index 00000000..0bea56d5 --- /dev/null +++ b/substr.js @@ -0,0 +1,5 @@ +//substr(): It takes two arguments,the starting index and number of characters to slice. +let string = 'JavaScript' +console.log(string.substr(4,6)) // Script +let country = 'Finland' +console.log(country.substr(3, 4)) // land \ No newline at end of file diff --git a/trim - Copy.js b/trim - Copy.js new file mode 100644 index 00000000..16785c43 --- /dev/null +++ b/trim - Copy.js @@ -0,0 +1,7 @@ +//trim(): Removes trailing space in the beginning or the end of a string. +let string = ' 30 Days Of JavaScript ' +console.log(string) // +console.log(string.trim(' ')) // +let firstName = ' Asabeneh ' +console.log(firstName) +console.log(firstName.trim()) // \ No newline at end of file diff --git a/trim.js b/trim.js new file mode 100644 index 00000000..16785c43 --- /dev/null +++ b/trim.js @@ -0,0 +1,7 @@ +//trim(): Removes trailing space in the beginning or the end of a string. +let string = ' 30 Days Of JavaScript ' +console.log(string) // +console.log(string.trim(' ')) // +let firstName = ' Asabeneh ' +console.log(firstName) +console.log(firstName.trim()) // \ No newline at end of file