diff --git a/.gitignore b/.gitignore index c206125..e8317f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ draft.md playground /playground -.DS_Store \ No newline at end of file +.DS_Store +test.js +day3.md \ No newline at end of file diff --git a/images/comparison_operators.png b/images/comparison_operators.png new file mode 100644 index 0000000..26ccb91 Binary files /dev/null and b/images/comparison_operators.png differ diff --git a/images/day-1.png b/images/day-1.png deleted file mode 100644 index 98a4d29..0000000 Binary files a/images/day-1.png and /dev/null differ diff --git a/images/day_1.png b/images/day_1.png new file mode 100644 index 0000000..7daf57f Binary files /dev/null and b/images/day_1.png differ diff --git a/images/google-chrome.png b/images/google-chrome.png deleted file mode 100644 index 5d66d13..0000000 Binary files a/images/google-chrome.png and /dev/null differ diff --git a/images/google_chrome.png b/images/google_chrome.png new file mode 100644 index 0000000..af06acd Binary files /dev/null and b/images/google_chrome.png differ diff --git a/images/js_code_on_chrome_console.png b/images/js_code_on_chrome_console.png index 24a67d8..7d6002c 100644 Binary files a/images/js_code_on_chrome_console.png and b/images/js_code_on_chrome_console.png differ diff --git a/images/opening_chrome_console_shortcut.png b/images/opening_chrome_console_shortcut.png index bae212f..eace03f 100644 Binary files a/images/opening_chrome_console_shortcut.png and b/images/opening_chrome_console_shortcut.png differ diff --git a/images/opening_developer_tool.png b/images/opening_developer_tool.png index 4d32e7a..6eb33dd 100644 Binary files a/images/opening_developer_tool.png and b/images/opening_developer_tool.png differ diff --git a/images/string_indexes.png b/images/string_indexes.png new file mode 100644 index 0000000..cc2f638 Binary files /dev/null and b/images/string_indexes.png differ diff --git a/readMe.md b/readMe.md index 435d9da..9d33d16 100644 --- a/readMe.md +++ b/readMe.md @@ -33,6 +33,31 @@ - [Comments](#comments) - [Variables](#variables) - [💻 Day 1: Exercises](#%f0%9f%92%bb-day-1-exercises) +- [📔 Day 2](#%f0%9f%93%94-day-2) +- [Data types](#data-types) +- [Numbers](#numbers) + - [Declaring number data types](#declaring-number-data-types) + - [Math Object](#math-object) +- [Strings](#strings) + - [String Concatenation](#string-concatenation) + - [Concatenating using addition operator](#concatenating-using-addition-operator) + - [Template Literals(Template Strings)](#template-literalstemplate-strings) + - [String Methods](#string-methods) +- [Booleans](#booleans-1) + - [Undefined](#undefined-1) + - [Null](#null-1) +- [Operators](#operators) + - [Assignment operators](#assignment-operators) + - [Arithmetic Operators](#arithmetic-operators) + - [Comparison Operators](#comparison-operators) + - [Logical Operators](#logical-operators) +- [💻 Day 2: Exercises](#%f0%9f%92%bb-day-2-exercises) + - [String Part](#string-part) + - [Data types Part](#data-types-part) + - [Arithmetic Operators Part](#arithmetic-operators-part) + - [Booleans Part](#booleans-part) + - [Comparison Operators](#comparison-operators-1) + - [Logical Operators](#logical-operators-1) @@ -40,7 +65,7 @@ # Introduction **Congratulations** for deciding to participate in a 30 days of JavaScript programming challenge . In this challenge you will learn everything you need to be a JavaScript programmer and in general the whole concepts of programming. In the end of the challenge you will get a 30DaysOfJavaScript programming challenge certificate. Join the [telegram group](https://t.me/ThirtyDaysOfJavaScript). -**A 30DaysOfJavaScript** is a guide for both beginners and advanced JavaScript developers. Welcome to JavaScript. JavaScript is the language of the browser. +**A 30DaysOfJavaScript** challenge is a guide for both beginners and advanced JavaScript developers. Welcome to JavaScript. I enjoy using and teaching JavaScript and I hope you will do so. JavaScript is the language of the browser. In this step by step tutorial, you will learn JavaScript, the most popular programming language in the history of mankind. You use JavaScript **_to add interactivity to websites, to develop mobile apps, desktop applications, games_** and nowadays JavaScript can be used for **_machine learning_** and **_AI_**. @@ -56,7 +81,7 @@ No prior knowledge of programming is required to follow this challenge. You need 5. Code Editor # Setup -I believe you have the motivation, computer and internet. +I believe you have the motivation and a strong desire to be a developer, computer and internet. If you have those you have everything. ## Install Node.js You may not need it right now but you may need it for later. Install [node.js](https://nodejs.org/en/). @@ -67,7 +92,7 @@ After downloading double click and install ![Install node](images/install_node.png) -We can check if node is installed in our machine by opening our device terminal or command prompt. +We can check if node is installed in our local machine by opening our device terminal or command prompt. ```sh asabeneh $ node -v @@ -78,9 +103,12 @@ I am using node version 12.14.0 which is the recommended version of node. ## Browser There are many browsers out there but I strongly recommend Google Chrome. ### Installing Google Chrome -Install [google chrome](https://www.google.com/chrome/) if you do not have one yet. We can write small JavaScript code on the browser console but we can not use the browser console to develop applications. +Install [google chrome](https://www.google.com/chrome/) if you do not have one yet. We can write small JavaScript code on the browser console but we do not use the browser console to develop applications. + +![Google Chrome](images/google_chrome.png) + ### Opening Google Chrome Console -You can open the google chrome either by clicking three dots at the top right corner of chrome or using short cut. I prefer short cuts. +You can open the google chrome either by clicking three dots at the top right corner of chrome browser or using a shortcut. I prefer using shortcuts. ![Opening chrome](images/opening_developer_tool.png) @@ -109,7 +137,7 @@ Windows: Ctl+Shift+I ``` #### Console.log -To write our first JavaScript code we used a builtin function **console.log()**. We passed an argument as an input data and the function display the output. We passed 'Hello, World' as input data or argument in the condole.log() function. +To write our first JavaScript code we used a builtin function **console.log()**. We passed an argument as an input data and the function display the output. We passed 'Hello, World' as input data or argument in the console.log() function. ```js console.log('Hello, World!') ``` @@ -256,7 +284,7 @@ This is how we write internal script most of the time. Writing the JavaScript co ``` Open the browser console to see the out put from the console.log() -![js code from vscode](./imas/js_code_ve) +![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. @@ -295,7 +323,7 @@ External Script in the body Open the browser console to see the out put from the console.log() ## Multiple External scripts We can link multiple external JavaScript files to a web page. -Create helloword.js file inside 30DaysOfJS folder and write the following code +Create helloworld.js file inside 30DaysOfJS folder and write the following code ```js console.log('Hello, World!') ``` @@ -309,10 +337,10 @@ console.log('Hello, World!') - + b}`) +``` +```sh +2 is greater than 3: false +``` +## String Methods +Everything in JavaScript is an object. String is a primitive data type that means we can not modify once it is created. String object has many string methods. There many string methods which can help us to work with strings. + +1. *length*: The string *length* method returns the number of characters in a string included empty space. + **Example:** + ```js + let js = 'JavaScript' + console.log(js.length) // 10 + let firstName = 'Asabeneh' + console.log(firstName.length) // 8 + ``` +2. *Accessing characters in a string*: We can access each characters in a string using its index. In programming counting starts from 0. The first index of the string is zero and the last index is one minus the length of the string + + ![Accessing sting by index](./images/string_indexes.png) +Let us access the first character in 'JavaScript' string. +```js +let string = 'JavaScript' +let firstLetter = string[0] +console.log(firstLetter) // J +let secondLetter = string[1] // a +let thirdLetter = string[2] +let lastLetter = string[9] +console.log(lastLetter) // t +let lastIndex = string.length - 1 +console.log(lastIndex) // 9 +console.log(string[lastIndex]) // t + +``` +3. *toUpperCase()*: this method changes the string to uppercase letters. +```js +let string = 'JavaScript' +console.log(string.toUpperCase()) // JAVASCRIPT +let firstName = 'Asabeneh' +console.log(firstName.toUpperCase()) // ASABENEH +let country = 'Finland' +console.log(country.toUpperCase()) // FINLAND + +``` + +4. *toLowerCase()*: this method changes the string to lowercase letters. +```js +let string = 'JavasCript' +console.log(string.toLowerCase()) // javascript +let firstName = 'Asabeneh' +console.log(firstName.toLowerCase()) // asabeneh +let country = 'Finland' +console.log(country.toLowerCase()) // finland + +``` +5. *substr()*: It takes two arguments,the starting index and number of characters to slice. +```js +let string = 'JavaScript' +console.log(string.substr(4,6) // Script +let country = 'Finland' +console.log(country.substr(3, 4)) // land + +``` +6. *substring()*: It takes two arguments,the starting index and the stopping index but it doesn't include the stopping index. + +```js +let string = 'JavaScript' +console.log(string.substring(0,4) // Java +console.log(string.substring(4,10) // Script +console.log(string.substring(4) // Script +let country = 'Finland' +console.log(country.substring(0, 3)) // Fin +console.log(country.substring(3, 7)) // land +console.log(country.substring(3)) // land + +``` +7. *split(): The split method splits a string at a specified place. + +```js +let string = '30 Days Of JavaScipt' +console.log(string.split()) // ["30 Days Of JavaScript"] +console.log(string.split(' ')) // ["30", "Days", "Of", "JavaScript"] +let firstName = 'Asabeneh' +console.log(firstName.split()) // ["Asabeneh"] +console.log(firstName.split('')) // ["A", "s", "a", "b", "e", "n", "e", "h"] +let countries = 'Finland, Sweden, Norway, Denmark, and Iceland' +console.log(countries.split(',')) // ["Finland", " Sweden", " Norway", " Denmark", " and Iceland"] +console.log(countries.split(', ')) //  ["Finland", "Sweden", "Norway", "Denmark", "and Iceland"] + +``` +8. *trim()*: Removes trailing space in the beginning or the end of a string. + +```js +let string = ' 30 Days Of JavaScript ' +console.log(string) // +console.log(string.trim(' ')) // +let firstName = ' Asabeneh ' +console.log(firstName) +console.log(firstName.trim()) // +``` +```sh + 30 Days Of JavasCript +30 Days Of JavasCript + Asabeneh +Asabeneh +``` +9. *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. + +```js +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 + +``` +10. *replace()*: takes to parameter the old substring and new substring. + +```js +string.replace(oldsubstring, newsubstring) +``` +```js +let string = '30 Days Of JavaScript' +console.log(string.replace('JavaScript', 'Python')) // 30 Days Of Python +let country = 'Finland' +console.log(country.replace('Fin', 'Noman')) Nomanland +``` +11. *charAt()*: Takes index and it returns the value at that index +```js +string.charAt(index) +``` +```js +let string = '30 Days Of JavaScript' +console.log(string.charAt(0)) // 3 +let lastIndex = string.length - 1 +console.log(string.charAt(lastIndex)) // t + +``` +12. *charCodeAt()*: Takes index and it returns char code(ASCII number) of the value at that index +```js +string.charCodeAt(index) +``` +```js +let string = '30 Days Of JavaScript' +console.log(string.charCodeAt(3)) // D ASCII number is 51 +let lastIndex = string.length - 1 +console.log(string.charCodeAt(lastIndex)) // t ASCII is 116 + +``` +13. *indexOf()*: Takes takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1 +```js +string.indexOf(substring) +``` +```js +let string = '30 Days Of JavaScript' +console.log(string.indexOf('D')) // 3 +console.log(string.indexOf('Days')) // 3 +console.log(string.indexOf('days')) // -1 +console.log(string.indexOf('a')) // 4 +console.log(string.indexOf('JavaScript')) // 11 +console.log(string.indexOf('Script')) //15 +console.log(string.indexOf('script')) // -1 + +``` +14. *lastIndexOf()*: Takes takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1 +```js +string.charCodeAt(index) +``` +```js +let string = 'I love JavaScript. If you do not love JavaScript what else can you love.' +console.log(string.lastIndexOf('love')) // 67 +console.log(string.lastIndexOf('you')) // 63 +console.log(string.lastIndexOf('JavaScript')) // 38 + +``` + +15. *concat()*: it takes many substrings and creates concatenation. +```js +string.concate(substring, substring, substring) +``` +```js +let string = '30' +console.log(string.concat("Days", "Of", "JavaScript")) // 30DaysOfJavaScript +let country = 'Fin' +console.log(country.concat("land")) // Finland + +``` + +16. *startsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false). +```js +string.startsWith(substring) +``` +```js +let string = 'Love is the best to in this world' +console.log(string.startsWith('Love')) // true +console.log(string.startsWith('love')) // false +console.log(string.startsWith('world')) // false + +let country = 'Finland' +console.log(country.startsWith('Fin')) // true +console.log(country.startsWith('fin')) // false +console.log(country.startsWith('land')) // false + +``` +17. *endsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false). +```js +string.endsWith(substring) +``` +```js +let string = 'Love is the best to in this world' +console.log(string.endsWith('world')) // true +console.log(string.endsWith('love')) // false +console.log(string.endsWith('in this world')) // true + +let country = 'Finland' +console.log(country.endsWith('land')) // true +console.log(country.endsWith('fin')) // false +console.log(country.endsWith('Fin')) // false + +``` +18. *search*: it takes a substring as an argument and it returns the index of the first match. +```js +string.serch(substring) +``` +```js +let string = 'I love JavaScript. If you do not love JavaScript what else can you love.' +console.log(string.search('love')) // 2 + +``` +1. *match*: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expresson pattern looks like. It starts with / sign and ends with / sign. + ```js + let string = 'love' + let patternOne = /love/ // with out any flag + let patternTwo = /love/gi // g-means to search in the whole text, i - case insensitive + + ``` +```js +string.match(substring) +``` +```js +let string = 'I love JavaScript. If you do not love JavaScript what else can you love.' +console.log(string.match('love')) // +/* +output + +["love", index: 2, input: "I love JavaScript. If you do not love JavaScript what else can you love.", groups: undefined] +*/ +let pattern = /love/gi +console.log(string.match(pattern)) // ["love", "love", "love"] + +``` +Let us extract numbers from text using regular expression. This is not regular expression section, no panic. +```js + +let txt = 'In 2019, I run 30 Days of Pyhton. Now, in 2020 I super exited to start this challenge' +let regEx = /\d+/ // d with escape character means d not a normal d instead acts a digit +// + means one or more digit numbers, +// if there is g after that it means global, search everywhere. +console.log(text.match(regEx)) // ["2", "0", "1", "9", "3", "0", "2", "0", "2", "0"] +console.log(text.match(/\d+/g)) // ["2019", "30", "2020"] +``` + +# Booleans + +A boolean data type represents one of the two values:_true_ or _false_. Boolean value is either true or false. The use of these data types will be clear when you start the comparison operator. Any comparisons return a boolean value which is either true or false. + +**Example: Boolean Values** +```js +let isLightOn = true; +let isRaining = false; +let hungery = false; +let isMarried = true; +``` + +### Undefined +If we declare a variable and if we do not assign a value, the value will be undefined. In addition to this, if a function is not returning the value will be undefined. + +```js +let firstName; +console.log(firstName); //not defined, because it is not assigned to a value yet +``` + +### Null + +```js +let empty = null; +console.log(empty); // -> null , means no value +``` + +# Operators + +## Assignment operators +An equal sign in JavaScript is an assignment operator. It uses to assign a variable. +```js +let firstName = 'Asabeneh' +let country = 'Finland' +``` +## Arithmetic Operators + +Arithmetic operators are mathematical operators. +- Addition(+): a + b +- Subtraction(-): a - b +- Multiplication(*):a * b +- Division(/): a / b +- Modulus(%):a % b +- Exponential(**):a ** b + +```js +let numOne = 4; +let numTwo = 3; +let sum = numOne + numTwo; +let diff = numOne - numTwo; +let mult = numOne * numTwo; +let div = numOne / numTwo; +let remainder = numOne % numTwo; +let powerOf = numOne ** numTwo +console.log(sum, diff, mult, div, remainder, powerOf); // ->7,1,12,1.33,1, 64 + +let PI = 3.14; +let radius = 100; // length in meter + +const gravity = 9.81; // in m/s2 +let mass = 72; // in Kilogram +const boilingPoint = 100; // temperature in oC, boiling point of water +const bodyTemp = 37; // body temperature in oC + +//Let us calculate area of a circle +const areaOfCircle = PI * radius * radius; +console.log(areaOfCircle); // -> 314 m +// Let us calculate weight of an object +const weight = mass * gravity; +console.log(weight); // -> 706.32 N(Newton) + +//Concatenating string with numbers using string interpolation +/* + The boiling point of water is 100 oC. + Human body temperature is 37 oC. + The gravity of earth is 9.81 m/s2. + */ +console.log( + `The boiling point of water is ${boilingPoint} oC.\nHuman body temperature is ${body} oC.\nThe gravity of earth is ${gravity} m / s2.` +); +``` +## Comparison Operators + +In programming we compare values, we use comparison operators to compare two values. We check if a value is greater or less or equal to other value. + +![Comparison Operators](./images/comparison_operators.png) +**Example: Comparison Operators** + +```js +console.log(3 > 2) // true, because 3 is greater than 2 +console.log(3 >= 2) // true, because 3 is greater than 2 +console.log(3 < 2) // false, because 3 is greater than 2 +console.log(2 < 3) // true, because 2 is less than 3 +console.log(2 <= 3) // true, because 2 is less than 3 +console.log(3 == 2) // false, because 3 is not equal to 2 +console.log(3 != 2) // true, because 3 is not equal to 2 +console.log(len('mango') == len('avocado')) // false +console.log(len('mango') != len('avocado')) // true +console.log(len('mango') < len('avocado')) // true +console.log(len('milk') != len('meat')) // false +console.log(len('milk') == len('meat')) // true +console.log(len('tomato') == len('potato')) // true +console.log(len('python') > len('dragon')) // false + +4 > 3; +4 >= 4; +4 < 3; +4 <= 3; +4 != 3; +4 !== '4'; +4 == '4'; +4 === '4'; +4 === 4; +``` + +## Logical Operators + +The following symbols are the common logical operators: +&&(ampersand) , ||(pipe) and !(negation). +&& gets true only if the two operands are true. +|| gets true either of the operand is true. +! negates true to false, false to true. + +```js +//&& ampersand example +const check = 4 > 3 && 10 > 5; // true and true -> true +const check = 4 > 3 && 10 < 5; // true and false -> false +const check = 4 < 3 && 10 < 5; // false and false -> false +//|| pipe or, example +const check = 4 > 3 || 10 > 5; // true and true -> true +const check = 4 > 3 || 10 < 5; // true and false -> true +const check = 4 < 3 || 10 < 5; // false and false -> false +//! Negation examples +let check = 4 > 3; // -> true +let check = !(4 > 3); // -> false +let isLightOn = true; +let isLightOff = !isLightOn; // -> false +let isMarried = !false; // -> true +``` + + +# 💻 Day 2: Exercises + +## String Part + +1. Declare a variable name challenge and assign it to an initial value **'30 Days Of JavaScript'**. +2. Print the string on the browser console using __console.log()__ +3. Print the __length__ of the string on the browser console using _console.log()_ +4. Change all the string to capital letters using __toUpperCase()__ method +5. Change all the string to lowercase letters using __toLowerCase()__ method +6. Cut(slice) out the first word of the string using __substr()__ or __substring()__ method +7. Slice out the phrase *Days Of JavaScript* from *30 Days Of JavaScript*. +8. Use __substr__ to slice out the phase __because because because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +9. Check if the string contains a word __Script__ using __includes()__ method +10. Split the __string__ into __array__ using __split()__ method +11. Split the string 30 Days Of JavaScript at the space using __split()__ method +12. 'Facebook, Google, Microsoft, Apple, IBM, Oracle, Amazon' __split__ the string at the comma and change it to an array. +13. Change 30 Days Of JavaScript to 30 Days Of Python using __replace()__ method. +14. What is character at index 15 in '30 Days Of JavaScript' string use __charAt()__ method. +15. What is the character code of J in '30 Days Of JavaScript' string using __charCodeAt()__ +16. Use __indexOf__ to determine the position of the first occurrence of a in 30 Days Of JavaScript +17. Use __lastIndexOf__ to determine the position of the last occurrence of a in 30 Days Of JavaScript. +18. Use __indexOf__ to find the position of the first occurrence of the word __because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +19. Use __lastIndexOf__ to find the position of the first occurrence of the word __because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +20. Use __search__ to find the position of the first occurrence of the word __because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +21. Use __trim()__ to remove if there is trailing whitespace at the beginning and the end of a string.E.g ' 30 Days Of JavaScript '. +22. Use __startsWith()__ method with the string *30 Days Of JavaScript* make the result true +23. Use __endsWith()__ method with the string *30 Days Of JavaScript* make the result true +24. Use __match()__ method to find all the a’s in 30 Days Of JavaScript +25. Use __match()__ to count the number all because's in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +26. Use __concat()__ and merge '30 Days of' and 'JavaScript' to a single string, '30 Days Of JavaScript' +27. Use __repeat()__ method to print 30 Days Of JavaScript 2 times +28. Love is the best thing in this world. Some found their love and some are still looking for their love. Count the number of word love in this sentence. +29. Calculate the total annual income of the person by extract the numbers from the following text. 'He earns 5000 euro from salary per month, 10000 euro annual bonus, 15000 euro online courses per month.' +30. Clean the following text(hint, use replace and regular express) +```js + sentence = '%I $am@% a %tea@cher%, &and& I lo%#ve %tea@ching%;. There $is nothing; &as& mo@re rewarding as educa@ting &and& @emp%o@wering peo@ple. ;I found tea@ching m%o@re interesting tha@n any other %jo@bs. %Do@es thi%s mo@tivate yo@u to be a tea@cher!?' +``` +## Data types Part + +String, number, boolean, null, undefined and symbol(ES6) are JavaScript primitive data types. + +1. The JavaScript typeof operator uses to check different data types. Check the data type of each variables from question number 1. +2. +## Arithmetic Operators Part +JavaScript arithmetic operators are addition(+), subtraction(-), multiplication(\*), division(/), modulus(%), increment(++) and decrement(--). + +```js +let operandOne = 4; +let operandTwo = 3; +``` +Using the above operands apply different JavaScript arithmetic operations. + +## Booleans Part + +Boolean value is either true or false. + +1. Write three JavaScript statement which provide truthy value. +1. Write three JavaScript statement which provide falsy value. +1. Use all the following comparison operators to compare the following values: >, < >=, <=, !=, !==,===. + Which are true or which are false ? + 1. 4 > 3 + 1. 4 >= 3 + 1. 4 < 3 + 1. 4 <= 3 + 1. 4 == 4 + 1. 4 === 4 + 1. 4 != 4 + 1. 4 !== 4 + 1. 4 != '4' + 1. 4 == '4' + 1. 4 === '4' + +## Comparison Operators + +Boolean value is either true or false. Any comparison return a boolean either true or false. +Use all the following comparison operators to compare the following values: >, < >=, <=, !=, !==,===. +Which are true or which are false ? + +1. 4 > 3 +1. 4 >= 3 +1. 4 < 3 +1. 4 <= 3 +1. 4 == 4 +1. 4 === 4 +1. 4 != 4 +1. 4 !== 4 +1. 4 != '4' +1. 4 == '4' +1. 4 === '4' + +## Logical Operators + +Which are true or which are false ? + +1. 4 > 3 && 10 < 12 +1. 4 > 3 && 10 > 12 +1. 4 > 3 || 10 < 12 +1. 4 > 3 || 10 > 12 +1. !(4 > 3) +1. !(4 < 3) +1. !(false) +1. !(4 > 3 && 10 < 12) +1. !(4 > 3 && 10 > 12) +1. !(4 === '4') + + + +