Dart Function High Order Function

Dart Function High Order Function

·

1 min read

High Order Function

  • When a function returns another function ,it is referred to as a High Order Function, or When a function takes parameter as a function, it is called a higher-order function.

Example

void main() 
{
      one() 
      {
            print('Hello, Dart!');
      }
      one();
      List<int> numbers = [1, 2, 3, 4, 5];

      numbers.forEach((number)
      {

            print('Doubled: ${number * 2}');

      }); 
}