// Recursive function that adds to the input value until 10 is reached
// Params: num — integer value
function recursive(num) {

    // Print the current value of the parameter
    console.log("Value of num at function call: " + num);

    // If num is less than 10, call the recursive function again
    if (num < 10) {

        // + symbols added to ensure proper integer addition
        recursive(+num + +1);

        // Otherwise, 10 has been reached
    } else {

        console.log("The value of num is 10.");

    }

}

// Array of starting values to test the recursive function with
var numsToTest = [0, 2, 4, 6, 8];

// Loop through each starting value
for (num in numsToTest) {

    // Print the current starting value being tested
    console.log("Current starting value: " + numsToTest[num]);

    // Call the recursive function with the current starting value
    recursive(numsToTest[num]);

}