Question 5
What will be the output of this code?
function createFunctions() { var funcs = []; for (var i = 0; i < 3; i++) { funcs.push(function() { return i; }); } return funcs;}
const functions = createFunctions();console.log(functions[0](), functions[1](), functions[2]());0, 1, 2
1, 2, 3
undefined, undefined, undefined
3, 3, 3