<html>
<head>
<script>
window.onload = function(){
var str = new Array(10).join('s');
console.log(str);//sssssssss
console.log(str.length);//9
}
</script>
js中构造重复字符串的一种简便方法
最新推荐文章于 2022-04-04 10:12:24 发布
<html>
<head>
<script>
window.onload = function(){
var str = new Array(10).join('s');
console.log(str);//sssssssss
console.log(str.length);//9
}
</script>