|
2 | 2 |
|
3 | 3 | The `typeof` operator (together with |
4 | 4 | [`instanceof`](#types.instanceof)) is probably the biggest |
5 | | -design flaw of JavaScript, as it is near of being **completely broken**. |
| 5 | +design flaw of JavaScript, as it is almost **completely broken**. |
6 | 6 |
|
7 | | -Although `instanceof` still has its limited uses, `typeof` really has only one |
| 7 | +Although `instanceof` still has limited uses, `typeof` really has only one |
8 | 8 | practical use case, which does **not** happen to be checking the type of an |
9 | 9 | object. |
10 | 10 |
|
11 | | -> **Note:** While `typeof` can also be called with a function like syntax |
12 | | -> i.e. `typeof(obj)`, this is not a function call. The two parenthesis will |
13 | | -> behave like normal and the return value will be used as the operand of the |
14 | | -> `typeof` operator. There is **no** `typeof` function. |
| 11 | +> **Note:** While `typeof` can also be called with a function like syntax, i.e. |
| 12 | +> `typeof(obj)`, this is not a function call. The parentheses behave as normal |
| 13 | +> and the return value will be used as the operand of the `typeof` operator. |
| 14 | +> There is **no** `typeof` function. |
15 | 15 |
|
16 | 16 | ### The JavaScript Type Table |
17 | 17 |
|
@@ -79,9 +79,8 @@ referencing it would result in a `ReferenceError`. This is the only thing |
79 | 79 | In order to check the type of an object, it is highly recommended to use |
80 | 80 | `Object.prototype.toString` because this is the only reliable way of doing so. |
81 | 81 | As shown in the above type table, some return values of `typeof` are not defined |
82 | | -in the specification; thus, they can differ across various implementations. |
| 82 | +in the specification; thus, they can differ between implementations. |
83 | 83 |
|
84 | | -Unless checking whether a variable is defined, `typeof` should be avoided at |
85 | | -**all costs**. |
| 84 | +Unless checking whether a variable is defined, `typeof` should be avoided. |
86 | 85 |
|
87 | 86 |
|
0 commit comments