[英]TypeError: (fn) is not iterable when just executing a function
所以我有一個非常簡單的代碼:
// doesn't matter, just be sure that we have an array
const tasks = Array.isArray(result) ? [...result] : [result];
// works
for (let i = 0; i < tasks.length; i++) {
this.executeNativeCommand(tasks[i].command, ...tasks[i].args);
}
// TypeError: this.executeNativeCommand is not iterable (cannot read property Symbol(Symbol.iterator))
tasks.forEach(task => {
this.executeNativeCommand(task.command, ...task.args);
});
還嘗試this['executeNativeCommand']
- 它有效。 這是什么魔法?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.