Last active
August 29, 2015 14:05
-
-
Save Daiz/cac4f25cc0c3ae039649 to your computer and use it in GitHub Desktop.
Stuff for https://github.com/eatnumber1/goal
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 g(a,b,c) { | |
c = !!+this; | |
if(!a && !b && !c) return g.bind(1,'go'); | |
if( a && !b && !c) return 'g' + a; | |
if( a && !b && c) return g.bind(1,a + 'o'); | |
if( a && b && c) return a + b; | |
} | |
function g(a,b) { | |
if(!+this) return a ? 'g' + a : g.bind(1,'go'); | |
else return b ? a + b : g.bind(1,a + 'o'); | |
} | |
function g(a,b) { | |
if(!+this) { b = a; a = 'g' } | |
return b ? a + b : g.bind(1, a + 'o'); | |
} | |
function g(a,b){if(!+this)b=a,a='g';return b?a+b:g.bind(1,a+'o')} | |
// this was my shortest result | |
function g(a,b){return +this||(b=a,a='g'),b?a+b:g.bind(1,a+'o')} | |
var s='g',g=function(x){return x?[s+x,s='g'][0]:(s+='o',g)} | |
var g=(function k(s){return s?this+s:k.bind(this+'o')}).bind('g') | |
var test = function(){ | |
var tmp = g()(); | |
console.log(g('al'),g()('al'),tmp('al'),g()()()('al')); | |
} | |
console.log(g('al'),g()('al'),g()()()('al')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment