I'm curious to know what the index variable returns in this code snippet. I believe it will be 0.
function jsTest() {
var index = 0;
var counter = 0;
var obj = {};
obj.index = index;
var func = function () {
for (index = 0; index < 10; index++) {
counter += 2;
}
obj.index++;
};
obj.func = func;
this.index++;
return index;
}