JavaScript循环和作用域

JavaScript有一个特点,也许会让开发者头痛, 是与循环和作用域相关的. 举个例子: const operations = [] for (var i = 0; i < 5; i++) { operations.push(()