Math.abs




' Math.abs(x) restituisce il valore assoluto (positivo) di x:


https://www.w3schools.com/js/tryit.asp?filename=tryjs_math_abs

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Math.abs()</h2>

<p>Math.abs(x) returns the absolute (positive) value of x:</p>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = Math.abs(-4.4);
</script>

</body>
</html>











( mathabs.html )- by Paolo Puglisi - Modifica del 17/12/2023