Example 1 — Official: Repeat a Word
The first sample from the Ramda docs: five copies of 'hi'.
console.log(R.repeat('hi', 5));
// ['hi', 'hi', 'hi', 'hi', 'hi'] How It Works
- Value.
'hi'is the item to repeat. - Count.
5means the new array has five slots. - Fill. Each slot gets
'hi'. - Result. A brand-new array of length 5.
