猿问

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

 axios.all(_array).then(axios.spread((...responses) => {

      console.log(responses)

  }));

以上改成ES5咋写,求问!

幕布斯7119047
浏览 427回答 2
2回答

德玛西亚99

"use strict";axios.all(_array).then(axios.spread(function () {&nbsp; for (var _len = arguments.length, responses = Array(_len), _key = 0; _key < _len; _key++) {&nbsp; &nbsp; responses[_key] = arguments[_key];&nbsp; }&nbsp; console.log(responses);}));这个是 babel 官网的转义结果

叮当猫咪

&nbsp; &nbsp; axios.all(_array).then(axios.spread(function () {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var responses = Array.from(arguments)&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(arguments)&nbsp;}));
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答