js判断一个数值为 +0

function isPosZero (n) {
  return n === 0 && 1 / n === Infinity
}

猜你喜欢

转载自blog.csdn.net/m0_37686205/article/details/89309746