**Please I am stuck with the * Math.abs()* function. How do I use it properly?

Hello! The `Math.abs()`

function returns the absolute value of a number-that is, it returns the positive reciprocal of that number:

```
Math.abs(5) >>returns 5
Math.abs(-2) >>returns 2
Math.abs(-98.7) >>returns 98.7
```

I hope this helps!

1 Like

Thank you for your response. This helped.

1 Like

Maths.abs(x) gives absolute number

For example

var x = Math.abs(98.3); //gives 98.3

var x = Math.abs(-98.3); //gives 98.3

var x = Math.abs(null); //gives 0

var x = Math.abs(“Hello”); //gives NaN Not A Number

var x = Math.abs(2+3); //gives 5

also depends what you are trying to achieve. You could share your thought with us for assist. Cheers

1 Like

Thanks a lot. It is clear now!

1 Like