abs

abs(number number) → integer result
Returns the absolute value of given number.

Returns the absolute value of the number number.

Parameters
Return
Notes

The expression abs(x) is equivalent to x > 0 ? x : -x.

Examples
var a = -12
var a_without_sign = abs(a)
debug(a_without_sign) // 12
const a = -12
const aWithoutSign = Math.abs(a)
Debug.log(aWithoutSign) // 12
a = -12
a_without_sign = abs(a)
Debug.log(a_without_sign)  # 12
var a = 12
var b = -5
var distance = abs(a - b)
debug(distance) // 17
const a = 12
const b = -5
const distance = Math.abs(a - b)
Debug.log(distance) // 17
a = 12
b = -5
distance = abs(a - b)
Debug.log(distance)  # 17