In the following code:
var MAX_NUMBER = 10;
function sum(x, y){
var result = x + y;
//Point A
return result;
}
function start(){
var num1 = Randomizer.nextInt(0, MAX_NUMBER);
var num2 = Randomizer.nextInt(0, MAX_NUMBER);
println( sum(num1, num2) );
}
JavaScript
Which variables exist at point A? In other words, which variables are in scope at point A? Which variables could you type at point A and the program would still work?
result only
result, x, and y
result, x, y, and MAX_NUMBER
result, num1, num2, and MAX_NUMBER
result, x, y, num1, num2, and MAX_NUMBER