爱淘FE

Posted by:
Mickey

每件事最后都会是好事,如果不是好事,说明还没到最后

750

JavaScript字符串转数字及取整

"12" | 0 //12
"12.34" | 0 //12
typeof ("12.34" | 0) //"number"

-------------------------------
+"12" //12
+"12.34" //12.34
typeof +"12.34" //"number"

发表评论


back up ↑