MCPcopy Create free account
hub / github.com/appacademy/Module-1-Resources / recurseArr

Function recurseArr

w3/d2/recursion.js:111–120  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

109// base case
110// recursive step
111function recurseArr(arr) {
112
113 if(arr.length === 0) return 'done recursing';
114
115 // how do we shorten the array - pop, shift, slice rest, spread
116 let popped = arr.pop();
117 console.log(popped, arr);
118
119 recurseArr(arr);
120};
121
122// console.log(recurseArr([1,2,3]));
123/*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected