Skip to main content
Module

x/core_fn/uncurry/mod.ts>repeat

A collection of built-in object method and property as currying function
Latest
variable repeat
import { repeat } from "https://deno.land/x/core_fn@v1.0.0-beta.16/uncurry/mod.ts";

Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned.

Examples

Example 1

repeat(0, 'abc') // ''
repeat(2, 'abc') // 'abcabc'

Example 2

// RangeError
repeat(-1, 'abc') // ''
repeat(Infinity, 'abc') // ''

type

(count: number, val: string) => string