You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
325 B

4 years ago
  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. };