I have the following JavaScript code:
function f(){
}
var arrOfFuncs = [f, f, f, f];
for (var i in arrOfFuncs){
console.log(typeof i);
console.log(i);
}
When I run the script it prints:
string
0
string
1
...
string
3
Since I am iterating over an array of functions, isn't "typeof i" supposed to be "function" and i.toString() supposed to be "function f(){}"?