index.js 325 B

12345678910111213141516171819
  1. /*!
  2. * repeat-element <https://github.com/jonschlinkert/repeat-element>
  3. *
  4. * Copyright (c) 2015-present, Jon Schlinkert.
  5. * Licensed under the MIT license.
  6. */
  7. 'use strict';
  8. module.exports = function repeat(ele, num) {
  9. var arr = new Array(num);
  10. for (var i = 0; i < num; i++) {
  11. arr[i] = ele;
  12. }
  13. return arr;
  14. };