Get your own website Result Size: 625 x 565
x
 
<!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.7);
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_math_abs by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 14:29:33 GMT -->
</html>