Created
March 21, 2016 02:34
-
-
Save allenkim67/6b174be0c4ae5a41e46d 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
function fn1(arr) { | |
if (arr.length === 1) { | |
return arr[0]; | |
} else { | |
return arr[0] + fn2(arr.slice(1)); | |
} | |
} | |
function fn2(arr) { | |
if (arr.length === 1) { | |
return arr[0]; | |
} else { | |
return arr[0] + fn3(arr.slice(1)); | |
} | |
} | |
function fn3(arr) { | |
if (arr.length === 1) { | |
return arr[0]; | |
} | |
} | |
fn1([1,2,3]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment