What will be the result of the following code? (without 'use strict')

function f(x, y, z) {
    x = 5;
    arguments[2] = 10;
    alert(x + y + z);
}
f(-1, 0, 1);
Explanation
arguments // [-1, 0, 1]
x = 5; // arguments [5, 0, 1]
arguments[2] = 10; // arguments [5, 0, 10]

Thanks, a lot @iliana000 ! Added!

2016 Jan 20, 4:50:17 PM

with the "use strict" the right answer is 6. Please, write in your task, that you are asking about the OLD standart

2016 Jan 17, 1:22:49 PM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes