GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update to JS Comparators lesson. · op2146/javascript@fea7c93

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • conditional
    • comparators.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎conditional/comparators.md‎

Copy file name to clipboardExpand all lines: conditional/comparators.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (country === "France") {
88
}
99
```
1010

11-
The conditional part is the country followed by the three equal signs (`===`). Three equal signs mean that the condition tests if the variable country has the value you test against but also the correct variable (data)type. You can test conditions with double equal signs, too, but that would mean that `if(x == 5)` would be true for x being 5 and x being “5”. Depending on what your program is doing, this could make quite a difference.
11+
The conditional part is the variable `country` followed by the three equal signs (`===`). Three equal signs tests if the variable `country` has both the correct value (`France`) and also the correct type (`String`). You can test conditions with double equal signs, too, however a conditional such as `if (x == 5)` would then return true for both `var x = 5;` and `var x = "5";`. Depending on what your program is doing, this could make quite a difference. It is highly recommended as a best practice that you always compare equality with three equal signs (`===` and `!==`) instead of two (`==` and `!=`).
1212

1313
Other conditional test:
1414

@@ -21,7 +21,7 @@ Other conditional test:
2121

2222
---
2323

24-
Add a condition to change the value of `a` to 10 if `x` is bigger than 5.
24+
Add a condition to change the value of `a` to the number 10 if `x` is bigger than 5.
2525

2626
```js
2727
var x = 6;
@@ -40,7 +40,7 @@ if (x > 5) {
4040
```
4141

4242
```js
43-
assert(a == 10);
43+
assert(a === 10);
4444
```
4545

46-
---
46+
---

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.