/*
* @desc:重復(fù)輸出字符串
* @param:str 要重復(fù)的字符串,如:'x'
* @param:num 重復(fù)次數(shù),如:4
* @return ret 回顯的字符串,如:'xxxx'
*/
function strrepeat(str,num){
var arr = new Array(num + 1)
var ret = arr.join(str)
return ret
}
var ret = strrepeat('x',4)
console.log(ret)
xxxx