Created
August 30, 2019 05:44
-
-
Save Dalmangyi/db280a4fc5a572e6a4e6cf64bff2bd89 to your computer and use it in GitHub Desktop.
Dart Closure Function Exam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function makeAdder(num addBy) { | |
return (num i) => addBy + i; | |
} | |
void main() { | |
var add2 = makeAdder(2); | |
var add4 = makeAdder(4); | |
print(add2(3)); | |
print(add4(3)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment