npm.io
1.1.2 • Published 7 years ago

string-repeat-x

Licence
MIT
Version
1.1.2
Deps
6
Size
239 kB
Vulns
0
Weekly
0

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

string-repeat-x

Constructs and returns a new string which contains the specified number of copies of the string.

module.exports*

Kind: Exported member
Returns: * - The target.

Param Type Description
string string The string.
count number string

Example

import repeat from 'string-repeat-x';

repeat('abc', -1); // RangeError
repeat('abc', 0); // ''
repeat('abc', 1); // 'abc'
repeat('abc', 2); // 'abcabc'
repeat('abc', 3.5); // 'abcabcabc' (count will be converted to integer)
repeat('abc', 1/0); // RangeError

Keywords