JSFiddle - React, Tailwind, and code Playground
by Farzad YZ
JavaScript
Array.prototype.repeat = function(times) {
return Array(times).fill().reduce((total) => total.concat(this), []);
}
console.log([1,2,3].repeat(2))
by Farzad YZ
Array.prototype.repeat = function(times) {
return Array(times).fill().reduce((total) => total.concat(this), []);
}
console.log([1,2,3].repeat(2))