Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Created March 12, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chooyan-eng/264cbaaa7e352812a196699ed68ce194 to your computer and use it in GitHub Desktop.
Save chooyan-eng/264cbaaa7e352812a196699ed68ce194 to your computer and use it in GitHub Desktop.
Test that var can be used at arguments of functions in Dart.
void main() {
printArg(10); // -> 10
printArg("10"); // -> 10
printArg([10, 20, 30]); // -> [10, 20, 30]
printArg({10, 20, 30}); // -> {10, 20, 30}
}
printArg(var arg) {
print(arg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment