运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Math</h1> <h2>The Math.log10() Method</h2> <p>Math.log10() returns the base-10 logarithm of a number:</p> <p id="demo"></p> <script> let a = Math.log10(2.7183); let b = Math.log10(2); let c = Math.log10(1); let d = Math.log10(0); let e = Math.log10(-1); document.getElementById("demo").innerHTML = a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e; </script> </body> </html>