Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
5
Task/Repeat-a-string/JavaScript/repeat-a-string-1.js
Normal file
5
Task/Repeat-a-string/JavaScript/repeat-a-string-1.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
String.prototype.repeat = function(n) {
|
||||
return new Array(1 + (n || 0)).join(this);
|
||||
}
|
||||
|
||||
console.log("ha".repeat(5)); // hahahahaha
|
||||
1
Task/Repeat-a-string/JavaScript/repeat-a-string-2.js
Normal file
1
Task/Repeat-a-string/JavaScript/repeat-a-string-2.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
console.log("ha".repeat(5)); // hahahahaha
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
String.prototype.repeat = function(n) {
|
||||
return new Array(1 + n).join(this);
|
||||
}
|
||||
|
||||
alert("ha".repeat(5)); // hahahahaha
|
||||
Loading…
Add table
Add a link
Reference in a new issue