.abs() / .round()
Absolute value and rounding.
Syntax
number.abs() // number.round()
Description
abs strips the sign (absolute value). round rounds to the nearest integer. floor rounds down, and ceil rounds up.
Example
Loading editor…
Expected output
5 4 4
When to use?
Calculating differences, rounding money/scores.