diff --git a/1-js/02-first-steps/06-type-conversions/article.md b/1-js/02-first-steps/06-type-conversions/article.md index cf4b446a3d..17f6f094e4 100644 --- a/1-js/02-first-steps/06-type-conversions/article.md +++ b/1-js/02-first-steps/06-type-conversions/article.md @@ -63,12 +63,12 @@ alert(age); // NaN, conversion failed number 类型转换规则: -| 值 | 变成... | +| 输入 | 输出 | |-------|-------------| |`undefined`|`NaN`| |`null`|`0`| |true 和 false | `1` and `0` | -| `string` | 字符串开始和末尾的空白会被移除,剩下的如果是空字符串,结果为 `0`,否则 —— 从字符串中读出数字。错误返回 `NaN`。 | +| `string` | 去掉首尾空格后的纯数字字符串中含有的数字。
如果字符串只由空格字符组成,返回 `0`。
如果字符串不是纯数字,则返回 `NaN`。 | 例如: