massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / repeat-element / index.js
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
8 'use strict';
9
10 module.exports = function repeat(ele, num) {
11   if (Array.prototype.fill) {
12     return new Array(num).fill(ele);
13   }
14
15   var arr = new Array(num);
16
17   for (var i = 0; i < num; i++) {
18     arr[i] = ele;
19   }
20
21   return arr;
22 };