xxxxxxxxxx
buildWord(['f', 'o', 'o'])
'f' + buildWord(['o', 'o'])
'f' + ('o' + buildWord(['o'])) // base case! return 'o' and fold
'f' + ('o' + ('o'))
'f' + ('oo')
'foo'
xxxxxxxxxx
function buildWord(chars) {
// base case:
if chars' length is 1
return the only char
// induction:
return first char + buildWord(chars minus the first char)
}