Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, December 6, 2012

Codecademy: Codeyear Recursing over a list


//sample solution


function printListStartingAtIndex(list, index) {
    if (index >= list.length) {
return;
    } else {
        //fill this in
        console.log(list[index]);
        printListStartingAtIndex(list, index+1);
}
}

//don't change these lines
var list = [0, 2, 4, 5, 6, 7, 9, 100];
printListStartingAtIndex(list, 0);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts