getWord function

String getWord(
  1. List<String> words,
  2. int selector(
    1. int
    )
)

Select the word from words using the selector.

Implementation

String getWord(List<String> words, int Function(int) selector) =>
    words[selector(words.length)];