function repeatStringNumTimes(string,times){ if(times<=0){ return ""; } if(times===1){ return string; } else return string+repeatStringNumTimes(string,times--); }alert(repeatStringNumTimes("abc",3));
添加回答
举报
0/150
提交
取消