Skip to content

Instantly share code, notes, and snippets.

@allenkim67
Created March 21, 2016 02:34
Show Gist options
  • Save allenkim67/6b174be0c4ae5a41e46d to your computer and use it in GitHub Desktop.
Save allenkim67/6b174be0c4ae5a41e46d to your computer and use it in GitHub Desktop.
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