js中字符串如何变数字类型

答:直接将该值减去0即可。
如:

let c ='1'
let d = c-0
console.log(typeof d) //number

猜你喜欢

转载自blog.csdn.net/qq_42931285/article/details/124679880