GeezerVison is showing github.com — Updated Basics Equality README.md · MorrielAlexis/JavaScript-Lessons@06a803b
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Basic_Concepts/Equality/README.md +31-7Lines changed: 31 additions & 7 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 |
|
3 | 3 | # Equality |
4 | 4 |
|
5 | | -Equality description |
| 5 | +Equality is when we use comparison operators to find out if both left and right compared value are equal, (AKA the same). |
6 | 6 |
|
7 | 7 |
|
8 | 8 | # Course Documentation |
9 | 9 |
|
10 | | -(this for me to fill up with every element that you use in lessons. syntax explaination and links for more) |
11 | 10 |
|
12 | | -## Element to explain |
| 11 | +## Comparison, (and logical), Operators |
| 12 | + |
| 13 | +In the code that we used |
| 14 | + |
| 15 | + |
| 16 | + var a = '26'; |
| 17 | + var b = 26; |
| 18 | + |
| 19 | + console.log(a==b); // true (only checks value) |
| 20 | + console.log(a===b); // false (compares type as well) |
| 21 | + |
| 22 | + |
| 23 | + Things are straight forward, as we explain the use of equal sign as comparison operator to find out if: |
| 24 | + |
| 25 | + **a==b** the values in both a and b, (variables) are the same |
| 26 | + and |
| 27 | + **a===b** both the values and the type of a and b variables are the same. |
| 28 | + |
| 29 | +In order to have a better understanding of logical operators here are few more examples of comparison and logical operators. |
| 30 | + |
| 31 | + |
| 32 | +- **!=** not equal values between a and b (left and right variable/statement). |
| 33 | +- **!==** not equal value or not equal type between a and b (left and right variable/statement). |
| 34 | +- **>** Left statement greater than right statement. |
| 35 | +- **<** Left statement less than right statement. |
| 36 | +- **>=** left statement greater than or equal to right statement. and |
| 37 | +- **<=** Left statement less than or equal to right statement. |
| 38 | + |
| 39 | +For more informations please visit the documentation page of w3schools [about comparison and logical operators](http://www.w3schools.com/js/js_comparisons.asp). |
13 | 40 |
|
14 | | -(for example console.log) |
15 | 41 |
|
16 | | -***Links*** |
17 | | - - Wikipedia |
18 | | - - Anotherlink,com |
| 42 | +> Written with [StackEdit](https://stackedit.io/). |