Why does Math.log(0) return -Infinity in JavaScript?

When my Math.log value getting zero it is giving -Infinity value. Why it is giving negative Infinity value? Why only giving -Infinity rather giving +Infinity. Why only 0 value is giving this result.

console.log(Math.log(0))

43 thoughts on “Why does Math.log(0) return -Infinity in JavaScript?”

Leave a Comment