Version: v0.7.1 - Beta.  We welcome contributors & feedback.

List.repeat

repeat($itemValue, $numItems) -> self

Description

Append a sequence of repeated items.

Note: The default method is a more memory-efficient alternative.

[].repeat(0, 5)
//= [0, 0, 0, 0, 0]

['a', 'b'].repeat('x', 3)
//= ['a', 'b', 'x', 'x', 'x']

See Also