Function js_sys::Math::abs

source ยท
pub fn abs(x: f64) -> f64
Expand description

The Math.abs() function returns the absolute value of a number, that is Math.abs(x) = |x|

MDN documentation