let go = (function() {
let v = 'go'
return function(val) {
v += val
if(val === 'l')
return v
return go
}
}())
console.log(go('l'))
console.log(go('o')('l'))
console.log(go('o')('o')('l'))
gol
gool
goool
let go = (function() {
let v = 'go'
return function(val) {
v += val
if(val === 'l')
return v
return go
}
}())
console.log(go('l'))
console.log(go('o')('l'))
console.log(go('o')('o')('l'))
gol
gool
goool