reactjs中有一个以
开头的条件+this.state.isCompleted
我们为什么要写+
?
答案 0 :(得分:1)
是强制conversion到number
const str = '1'
const bool = false
const fail = 'isNan?'
const num = +str
const numBool = +bool
const numFail = +fail
console.log(typeof num, typeof numBool, numFail)