代碼截圖以下:javascript
執行效果以下:java
代碼以下:spa
<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>