absValue property
int
get
absValue
Returns the absolute value of the number.
Example:
(-5).absValue; // 5
5.absValue; // 5
Implementation
int get absValue => this < 0 ? -this : this;
Returns the absolute value of the number.
Example:
(-5).absValue; // 5
5.absValue; // 5
int get absValue => this < 0 ? -this : this;