Skip to content

Commit

Permalink
fix: Eliminate duplicate entries for null>=0 #232 (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
bence98 authored Apr 26, 2022
1 parent 34357b4 commit af3a6d8
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Currently, there are these translations of **wtfjs**:
- [Tricky return](#tricky-return)
- [Chaining assignments on object](#chaining-assignments-on-object)
- [Accessing object properties with arrays](#accessing-object-properties-with-arrays)
- [Null and Relational Operators](#null-and-relational-operators)
- [`Number.toFixed()` display different numbers](#numbertofixed-display-different-numbers)
- [`Math.max()` less than `Math.min()`](#mathmax-less-than-mathmin)
- [Comparing `null` to `0`](#comparing-null-to-0)
Expand Down Expand Up @@ -1666,19 +1665,6 @@ The brackets `[]` operator converts the passed expression using `toString`. Conv
["property"].toString(); // -> 'property'
```

## Null and Relational Operators

```js
null > 0; // false
null == 0; // false

null >= 0; // true
```

### 💡 Explanation:

Long story short, if `null` is less than `0` is `false`, then `null >= 0` is `true`. Read in-depth explanation for this [here](https://blog.campvanilla.com/javascript-the-curious-case-of-null-0-7b131644e274).

## `Number.toFixed()` display different numbers

`Number.toFixed()` can behave a bit strange in different browsers. Check out this example:
Expand Down Expand Up @@ -1798,6 +1784,7 @@ true;

- [**7.2.12** Abstract Relational Comparison](https://www.ecma-international.org/ecma-262/#sec-abstract-relational-comparison)
- [**7.2.15** Abstract Equality Comparison](https://262.ecma-international.org/11.0/index.html#sec-abstract-equality-comparison)
- [An in-depth explanation](https://blog.campvanilla.com/javascript-the-curious-case-of-null-0-7b131644e274)

## Same variable redeclaration

Expand Down

0 comments on commit af3a6d8

Please sign in to comment.