what is it called when a function calls itself
Recursion
javascript recursion over array
function recurse(arr=[])
{
// base case, to break the recursion when the array is empty
if (arr.length === 0) {
return;
}
// destructure the array
const [x, ...y] = arr;
// Do something to x
return recurse(y);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us