Created
March 10, 2014 16:16
-
-
Save kusano/9468173 to your computer and use it in GitHub Desktop.
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
// 1個目の引数を返す関数 Trueになる | |
function t(a,b) {return a;} | |
// 2個目の引数を返す関数 Falseになる | |
function f(a,b) {return b;} | |
// aがTrueならbを、aがFalseならcを返す | |
function test(a,b,c) {return a(b,c);} | |
test(t,"x","y") // "x" | |
test(f,"x","y") // "y" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment