我在代码中看到了传播语法的几种用法。例如:
function tree2table(tree) {
var children = tree["children"];
if (children === undefined) return [];
var result = [];
for (var i = 0; i < children.length; i++) {
var child = children[i];
var link = [child["name"], tree["name"], child["size"]];
result.push(link);
result.push(...tree2table(child))
}
return result
}
但是,IE 不支持扩展语法。有谁知道改变它以result.push(...tree2table(child))
使其成为跨浏览器并像以前一样高效的最佳方法是什么?