关于ES6...运算符求问!!

 axios.all(_array).then(axios.spread((...responses) => {
      console.log(responses)
  }));

以上改成ES5咋写,求问!

阅读 2.2k
3 个回答
"use strict";

axios.all(_array).then(axios.spread(function () {
  for (var _len = arguments.length, responses = Array(_len), _key = 0; _key < _len; _key++) {
    responses[_key] = arguments[_key];
  }

  console.log(responses);
}));

这个是 babel 官网的转义结果

已解决

    axios.all(_array).then(axios.spread(function () {
                        var responses = Array.from(arguments) 
                        console.log(arguments)
 }));

...arr 改成 [].slice.call(arr)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题