Dart Programming - Abs Method



This property is used to return an integer representing the absolute value of a number.

Syntax

 Number.abs() 

Example

 void main() { var a = -2; print(a.abs()); } 

It will produce the following output −.

 2 
dart_programming_numbers.htm
Advertisements