log()
Math对象的函数接受一个数字,并返回给定数字的自然对数(以e为底)。
其语法如下
Math.log(48);
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var result = Math.log(48); document.write("Result: "+result); </script> </body> </html>
输出结果
Result: 3.8712010109078907