JS for_of遍历数组
代码截图如下:
执行效果如下:
代码如下:
<script type="text/javascript"> var arr = ['1','2','3','3','4','5','5','5','5','5',['1','2']]; function str() { var strs = ""; for( var arrs of arr){ strs += arrs+"<br>"; } document.write(strs); } str(); </script>