javascript 不同型態比較不相等
在取部份字串時, 用 substr 取是 String ,match 取是 Object ,直接 if(substr == match) 傳回 False 必須改字串才能比較,如下:
var str = 'c002';
mstr = str.match(/\d+/).toString();
sstr = str.substr( 1 , 3 ).toString();
alert(mstr + " = " + typeof(mstr) + "\n" + sstr + " = " + typeof(sstr));
迴響
javascript 不同型態比較不相等 | 豬窩
I amm extremely impressed along with your writing skills as wel
ass withh the structure tto your blog. Is that thijs a paid
subhject oor didd yoou mopdify it yoyr self? Anyyway styay
up the excellent high quhality writing, it's uncommkon tto see a nice webhlog like thyis onne theese days..
javascript 不同型態比較不相等 | 豬窩
Hello friends, how is all, and whazt yyou wat to say regfarding his
pkece of writing, in mmy vie iits trily amazxing designerd for me.