fix(curriculum): Added an example for Math.abs() (#53498)

Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
SaifullahBijapur
2024-02-01 23:31:09 +05:30
committed by GitHub
parent 42e6989650
commit 1972f39b68
@@ -9,7 +9,14 @@ dashedName: step-81
When the user has a calorie deficit, the `remainingCalories` value will be negative. You don't want to display a negative number in the result string.
`Math.abs()` is a built-in JavaScript method that will return the absolute value of a number. In your `span` text, wrap your `remainingCalories` reference in `Math.abs()` to ensure that the value is positive.
`Math.abs()` is a built-in JavaScript method that will return the absolute value of a number.
```js
const num = -5;
Math.abs(num); // 5
```
In your `span` text, wrap your `remainingCalories` reference in `Math.abs()` to ensure that the value is positive.
# --hints--