The abs() method returns the absolute value of a number.
Example
Demo
Math.abs(x)Parameter is required and must be a numeric value.
Example
<script>Sample code and demo is here
document.write(Math.abs(7.25) + "<br />")
document.write(Math.abs(-7.25) + "<br />")
document.write(Math.abs(7.25-10))
</script>
Demo
No comments:
Post a Comment