Unit6-Array_lastIndexOf


1
2
3
4
5
6
7
8
9
10
// function repeat(str, times) { }
function repeat(str, n) {
let result = ''
for(let i = 1; i < n; i++) {
result += str
}
return result
}

console.log('abc', 3)

Author: Jayson-Zheng
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source Jayson-Zheng !
  TOC