|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
537 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Repeats the given string n times.
|
|---|
| 3 | *
|
|---|
| 4 | * If n is less than 1, an empty string is returned, or if the string is an empty string,
|
|---|
| 5 | * the original string is returned unchanged.
|
|---|
| 6 | *
|
|---|
| 7 | * @param {string} str - The string to repeat.
|
|---|
| 8 | * @param {number} n - The number of times to repeat the string.
|
|---|
| 9 | * @returns {string} - The repeated string, or an empty string if n is less than 1.
|
|---|
| 10 | *
|
|---|
| 11 | * @example
|
|---|
| 12 | * repeat('abc', 0); // ''
|
|---|
| 13 | * repeat('abc', 2); // 'abcabc'
|
|---|
| 14 | */
|
|---|
| 15 | declare function repeat(str?: string, n?: number): string;
|
|---|
| 16 |
|
|---|
| 17 | export { repeat };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.