- 0133技术站
- 联系QQ:18840023
- QQ交流群
- 微信公众号
ES 6 Math.pow()
Math.pow()方法返回指数幂的基数,例Math.pow(x, y),返回x的y次方。
语法:
Math.pow(x, y)
参数
● x - 代表基数
● y - 代表指数
返回值:
返回指数幂的基数。
例:
console.log("---Math.pow()---") console.log("math.pow(2,3) : "+Math.pow(2, 3)) console.log("Math.pow(1.7, 2.3) : "+Math.pow(1.7, 2.3))
输出:
---Math.pow()--- math.pow(2,3) : 8 Math.pow(1.7, 2.3) : 3.388695291147646
推荐手册