What is the output?
extension on int {
int get doubled => this * 2;
}
void main() {
print(5.doubled);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
10
Explanation:
Extension methods add functionality to existing types without modification.
[/spoiler]