From fa826823ece4adc11391e3bf0e88c1fe1ac2c324 Mon Sep 17 00:00:00 2001 From: Cyan <917244295@qq.com> Date: Fri, 14 Apr 2023 15:56:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E7=9A=84toString?= =?UTF-8?q?=E5=BA=94=E4=B8=BA'[object=20Object]'=E8=80=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF'object'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-JavaScript基础/09-数据类型转换.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-JavaScript基础/09-数据类型转换.md b/04-JavaScript基础/09-数据类型转换.md index e395389..17c9132 100644 --- a/04-JavaScript基础/09-数据类型转换.md +++ b/04-JavaScript基础/09-数据类型转换.md @@ -93,7 +93,7 @@ console.log(a1.toString()); // "qianguyihao" console.log(a2.toString()); // "29" console.log(a3.toString()); // "true" console.log(a4.toString()); // "1,2,3" -console.log(a5.toString()); // "object" +console.log(a5.toString()); // "[object Object]" // 下面这两个,打印报错 console.log(a6.toString()); // 报错:Uncaught TypeError: Cannot read properties of null From dcb12f91b06fdecbdd3cc2a6e32927a1e52a27f0 Mon Sep 17 00:00:00 2001 From: Cyan <917244295@qq.com> Date: Fri, 14 Apr 2023 16:17:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-JavaScript基础/09-数据类型转换.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-JavaScript基础/09-数据类型转换.md b/04-JavaScript基础/09-数据类型转换.md index 17c9132..0b4f3ae 100644 --- a/04-JavaScript基础/09-数据类型转换.md +++ b/04-JavaScript基础/09-数据类型转换.md @@ -287,7 +287,7 @@ parseInt('5'); // 得到的结果是数字 5 (2)如果字符串不是以数字开头,则转换为 NaN。 -(3)如果字符串是一个空串或者是一个全是空格的字符串,转换时会报错。 +(3)如果字符串是一个空串或者是一个全是空格的字符串,则转换为 NaN。 **情况二:Boolean --> 数字**,结果为:NaN