js & Number & String All In One


js & Number & String All In One

js Number & String compare


//  labelWeight = 0.022 string
0.022 < 0.33
// true

"0.022" < "0.33"
// true

"0.34" < "0.33"
// false

"0.34" < 0.33
// false

"0.32" < 0.33
// true

0.32 < "0.33"
// true

0.34 < "0.33"
// false



分别写出如下代码的返回值

String('11') == new String('11');
String('11') === new String('11');

String('11') == new String('11');
true

String('11') === new String('11');
false

String('11')
"11"

typeof String('11')
// "string"

new String('11');
String {"11"}

typeof new String('11');
// "object"


refs

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String


Flag Counter

?xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有??xgqfrms, 禁止转载 ???,侵权必究??!