All:
[UPDATE problem solved] The problem I have here is: so if I use "in", the func is the index number while using "of" the func is the function. More detail refer to Variables and scoping in ECMAScript 6
This is my first hour of ES6 study, I wonder why I can not use syntax like:
for(func in funcs) { }
In:
"use strict";
var funcs = [];
for(let i=0; i<10; i++){
funcs.push(function(){
console.log(i);
});
}
let func;
for(func in funcs){
func();
}
It always reports:
Uncaught TypeError: func is not a function