Created
January 23, 2018 17:01
-
-
Save simonelp/ff9aa8ed12d8fd5d01be1a9507cd28de 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
const f = (char) => { | |
const inside = (char) => { | |
if(char) { | |
output += char; | |
console.log(output); | |
return true; | |
} else { | |
output = output + 'o'; | |
return inside; | |
} | |
} | |
let output = 'f'; | |
if(char){ | |
console.log(output + char); | |
} else { | |
inside(); | |
} | |
return inside; | |
}; | |
const g = (letter) => { | |
console.log('f'); | |
if (letter) console.log(letter); | |
const _f = (_letter = 'o') => { | |
if (_letter === 'l') console.log('o'); | |
console.log(_letter); | |
return _f; | |
}; | |
return _f; | |
}; | |
function f (char, myString) { | |
let string = myString | |
if (typeof (string) === 'undefined') { | |
string = 'f'; | |
} | |
if (typeof (char) !== 'undefined'){ | |
string = string + char; | |
} else { | |
return function (char) { | |
if (typeof (char) !== 'undefined'){ | |
return string = string + 'o' + char; | |
} | |
else { | |
string = string + 'o'; | |
return f(char, string); | |
} | |
} | |
} | |
return string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment