JavaScript 判断负零 - acwong00/blog GitHub Wiki

function isNegZero(n) {
  n = Number(n)
  return (n === 0) && (1 / n === -Infinity)
}