您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.js 418B

12345678910111213141516171819202122
  1. /*!
  2. * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
  3. *
  4. * Copyright (c) 2014-2017, Jon Schlinkert.
  5. * Released under the MIT License.
  6. */
  7. 'use strict';
  8. module.exports = function (arr) {
  9. return flat(arr, []);
  10. };
  11. function flat(arr, res) {
  12. var i = 0, cur;
  13. var len = arr.length;
  14. for (; i < len; i++) {
  15. cur = arr[i];
  16. Array.isArray(cur) ? flat(cur, res) : res.push(cur);
  17. }
  18. return res;
  19. }