Skip to content

Instantly share code, notes, and snippets.

@fselcukcan
Created September 4, 2019 20:27
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 fselcukcan/86effaabd22e2706943442285111f1a2 to your computer and use it in GitHub Desktop.
Save fselcukcan/86effaabd22e2706943442285111f1a2 to your computer and use it in GitHub Desktop.
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