You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
repeat = function repeat(str, count) {
|
|
if(typeof(count) == "undefined") {
|
|
count =1;
|
|
}
|
|
return count < 1 ? '' : new Array(count + 1).join(str);
|
|
}
|
|
console.log(repeat('Ha!'));
|
|
console.log(repeat('Ha!',2));
|
|
console.log(repeat('Ha!',3));
|