From 7709c20bb38c10674a74c6dcc50578c08a64e266 Mon Sep 17 00:00:00 2001 From: fakeinc Date: Sat, 8 Jun 2019 23:43:40 -0400 Subject: [PATCH 1/2] Make the description more readable. --- 1-js/02-first-steps/06-type-conversions/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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..ceeb73b808 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` 。 | 例如: From 358f7703ce21be4f7bdfd75af3835f2ac670c7fe Mon Sep 17 00:00:00 2001 From: LeviDing Date: Sun, 9 Jun 2019 15:21:55 +0800 Subject: [PATCH 2/2] Update article.md --- 1-js/02-first-steps/06-type-conversions/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ceeb73b808..17f6f094e4 100644 --- a/1-js/02-first-steps/06-type-conversions/article.md +++ b/1-js/02-first-steps/06-type-conversions/article.md @@ -68,7 +68,7 @@ number 类型转换规则: |`undefined`|`NaN`| |`null`|`0`| |true 和 false | `1` and `0` | -| `string` | 去掉首尾空格后的纯数字字符串中含有的数字。
如果字符串只由空格字符组成,返回 `0` 。
如果字符串不是纯数字,则返回 `NaN` 。 | +| `string` | 去掉首尾空格后的纯数字字符串中含有的数字。
如果字符串只由空格字符组成,返回 `0`。
如果字符串不是纯数字,则返回 `NaN`。 | 例如: