diff --git a/types & grammar/ch4.md b/types & grammar/ch4.md index 3e4ce9251..ec9158ba7 100644 --- a/types & grammar/ch4.md +++ b/types & grammar/ch4.md @@ -246,7 +246,7 @@ If any non-`number` value is used in a way that requires it to be a `number`, su For example, `true` becomes `1` and `false` becomes `0`. `undefined` becomes `NaN`, but (curiously) `null` becomes `0`. -`ToNumber` for a `string` value essentially works for the most part like the rules/syntax for numeric literals (see Chapter 3). If it fails, the result is `NaN` (instead of a syntax error as with `number` literals). One example difference is that `0`-prefixed octal numbers are not handled as octals (just as normal base-10 decimals) in this operation, though such octals are valid as `number` literals (see Chapter 2). +`ToNumber` for a `string` value essentially works for the most part like the rules/syntax for numeric literals (see Chapter 2). If it fails, the result is `NaN` (instead of a syntax error as with `number` literals). One example difference is that `0`-prefixed octal numbers are not handled as octals (just as normal base-10 decimals) in this operation, though such octals are valid as `number` literals (see Chapter 2). **Note:** The differences between `number` literal grammar and `ToNumber` on a `string` value are subtle and highly nuanced, and thus will not be covered further here. Consult section 9.3.1 of the ES5 spec for more information. @@ -1825,7 +1825,7 @@ The "Abstract Relational Comparison" algorithm in ES5 section 11.8.5 essentially **Note:** The algorithm is only defined for `a < b`. So, `a > b` is handled as `b < a`. -The algorithm first calls `ToPrimitive` coercion on both values, and if the return result of either call is not a `string`, then both values are coerced to `number` values using the `ToNumber` operation rules, and compared numerically. +The algorithm first calls `ToPrimitive` coercion on both values, and if the return results of both calls are not `string`s, then both values are coerced to `number` values using the `ToNumber` operation rules, and compared numerically. For example: