Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (27 sloc) 444 Bytes
**question
What value is output by each evaluation of fns[2]?
**question
**code
function functionGenerator(){
var x = 0;
var f1 = function() { x += 1; }
var f2 = function() { x += 2; }
var f3 = function() { return x; }
return [f1, f2, f3];
}
var fns = functionGenerator();
fns[2]();
fns[0]();
fns[2]();
fns[1]();
fns[2]();
**code
**possibleAnswers
0, 0, 0
0, 1, 3
0, 1, 2
0, 3, 1
**possibleAnswers
**correctIndex
1
**correctIndex
Something went wrong with that request. Please try again.