JS之數據類型轉換

數據類型轉換 其他類型轉爲字符串(string) 1. x.toString() console.log理論上只能接受字符串: console.log(1)將轉換成console.log( (1).toString() ) 2. String(x) 3. 簡便方法: x + '' > 1+'1' < '11' 等價於(1).toString()+'1' 其他類型轉爲數值(number) Numbe
相關文章
相關標籤/搜索