index.js 316 B

123456789101112131415161718
  1. /*!
  2. * repeat-element <https://github.com/jonschlinkert/repeat-element>
  3. *
  4. * Copyright (c) 2015 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. };