mirror of
https://github.com/qianguyihao/Web.git
synced 2024-11-01 05:24:45 +08:00
Merge dcb12f91b0
into a903cc798f
This commit is contained in:
commit
3ec3c0019b
@ -101,7 +101,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
|
||||
@ -299,7 +299,7 @@ parseInt('5'); // 得到的结果是数字 5
|
||||
|
||||
(2)如果字符串不是以数字开头,则转换为 NaN。
|
||||
|
||||
(3)如果字符串是一个空串或者是一个全是空格的字符串,转换时会报错。
|
||||
(3)如果字符串是一个空串或者是一个全是空格的字符串,则转换为 NaN。
|
||||
|
||||
**情况二:Boolean --> 数字**,结果为:NaN
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user