Created
September 4, 2019 20:27
-
-
Save fselcukcan/86effaabd22e2706943442285111f1a2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 f(x) { | |
return function g(y) { | |
x = x + y; | |
return x; | |
} | |
} | |
g1 = f(3); | |
// her çağrılışında aynı argümanla bile yeni bir değer döner | |
g1(2) // => 5 | |
g1(2) // => 7 | |
g1(2) // => 9 | |
// hatta sadece n kez çalışan bir fonksiyon da tanımlayabilirsin içtekinin içine if koy vs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment