成长中的林 2022-05-28 15:59 采纳率: 75%
浏览 38
已结题

使用微信开发者工具JS编译中else if条件不成立为什么依旧会进去

微信开发者工具JS编译中else if条件不成立为什么依旧会进去

let Unit
let CY =parseInt(bigNum.add(Cycleunit[0],-3),16)
 //此时CY为9
let Cycleunit3

  if(CY<4){
    Unit ="分"
    let Cycleunit1 = Cycleunit.join("")
    let Cycleunit2 = bigNum.add(Cycleunit1,-33)
    Cycleunit3 = parseInt(Cycleunit2,16)
  }
  else if(4<=CY<=7){
    Unit ="时"
    let Cycleunit1 = Cycleunit.join("")
    let Cycleunit2 = bigNum.add(Cycleunit1,-73)
    Cycleunit3 = parseInt(Cycleunit2,16)
  }
  else if(8<=CY<=11){
      Unit ="日"
      let Cycleunit1 = Cycleunit.join("")
      let Cycleunit2 = bigNum.add(Cycleunit1,-"b3")
      Cycleunit3 = parseInt(Cycleunit2,16)
    }
  • 写回答

1条回答 默认 最新

  • 你好!机器人 2022-05-28 16:18
    关注

    else if(4<=CY<=7){ 不能这样写
    else if(CY>=4 && CY<=7){

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 6月5日
  • 已采纳回答 5月28日
  • 创建了问题 5月28日