鍍金池/ 問答/HTML/ 關(guān)于ES6...運算符求問!!

關(guān)于ES6...運算符求問?。?/h1>
 axios.all(_array).then(axios.spread((...responses) => {
      console.log(responses)
  }));

以上改成ES5咋寫,求問!

回答
編輯回答
不討喜

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

2017年9月15日 23:21
編輯回答
離觴

已解決

    axios.all(_array).then(axios.spread(function () {
                        var responses = Array.from(arguments) 
                        console.log(arguments)
 }));
2017年1月11日 09:55
編輯回答
巫婆
"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 官網(wǎng)的轉(zhuǎn)義結(jié)果

2017年1月19日 01:46