+Variables, JS rules/data conversion

+Variable: This is a rule conversion, which can be understood as Number (variable)

  • For boolean: true returns 1, false returns 0

  • For null: return 0

  • For undefined, put back NaN
    -for string, return decimal, ignore the preceding 0, empty string returns 0,

十分方便

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45629623/article/details/107795274