What is the output?
void main() {
int calc({
required int a,
int b = 2,
}) {
return a * b;
}
print(calc(a: 5));
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
10
Explanation:
Named parameters use names for clarity; b defaults to 2 when omitted.
[/spoiler]