我們知道String()與 toString()都是可以轉(zhuǎn)換為字符串類型,但是String()與 toString()的還是有區(qū)別的
1..toString()可以將所有的的數(shù)據(jù)都轉(zhuǎn)換為字符串,但是要排除null 和 undefined
2.String()可以將null和undefined轉(zhuǎn)換為字符串,但是沒法轉(zhuǎn)進(jìn)制字符串
1..toString()可以將所有的的數(shù)據(jù)都轉(zhuǎn)換為字符串,但是要排除null 和 undefined
2.String()可以將null和undefined轉(zhuǎn)換為字符串,但是沒法轉(zhuǎn)進(jìn)制字符串