2012-02-13 62 views

回答

5

您應該使用Math.abs(number)來做到這一點。

8

使用Math.abs

例如:document.write(Math.abs(-5))

2

abs()方法返回一個數字的絕對值。
var pos = Math.abs(x)

相關問題