js中将string变成number类型的快速方法

number = string*1;

string = number+'';

 var str = '012.8372';
 var s = 0;
 str = str*1;
 alert(typeof(str));//number
 s += '';
 alert(typeof(s));//string
 var boo = true;
 alert(typeof(boo));//boolean
 var bs = Boolean(s);
 alert("bs:"+typeof(bs));
 alert("bsv:"+bs);//true

原文地址:https://www.cnblogs.com/guanghuiqq/p/2745048.html