Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,34 @@ function combine(val1, val2) {

**[⬆ back to top](#table-of-contents)**

### Strict Equality & Loose Equality (part 3)

Use non-strict comparison operators, and then comparing across different types. The bad example did not provide expected results for using non-strict comparison operators (==). It only compare between values, but not with identical. So, To get our expected output we have to use ‘===’ instead of ‘==’, for instance.

**Bad:**

```javascript
1 == “1”; // true
0 == false; // true
null == undefined; // true
[] == false // true
1 == true // true
"" == 0 // true
```

**Good:**

```javascript
1 === “1”; // false
0 === false; // false
null === undefined; // false
[] === false // false
1 === true // false
"" === 0 // false
```

**[⬆ back to top](#table-of-contents)**

### Don't over-optimize

Modern browsers do a lot of optimization under-the-hood at runtime. A lot of
Expand Down