logo CodeStepByStep logo

arrayMystery11

Language/Type: JavaScript arrays array mystery

What are the resulting values of the following arrays after passing each as an argument to the function below?

function arrayMystery11(arr) {
    for (let i = 1; i < arr.length; i++) {
        arr[i] = arr[i] + arr[i - 1];
    }
}
[8]
[6, 3]
[2, 4, 6]
[1, 2, 3, 4]
[7, 3, 2, 0, 5]

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.