Flutter ● ○ ○

Kodebits Day 53: Arrow Function Return

Jul 6 2026
Practice arrow functions with a short dart challenge.

What does this print?

int triple(int n) => n * 3;

int calc(int x) =>
  triple(x) + 2;

void main() {
  print(calc(4));
}


Try it in the online Dart Playground →

[spoiler title="Solution"]

Answer:

14

Explanation:

Arrow syntax => provides a concise way to write single-expression functions.

[/spoiler]


Further Reading