zoukankan      html  css  js  c++  java
  • For...In 声明

    <html>
    <body>
    
    <script type="text/javascript">
    var x
    var mycars = new Array()
    mycars[0] = "Saab"
    mycars[1] = "Volvo"
    mycars[2] = "BMW"
    
    for (x in mycars)
    {
    document.write(mycars[x] + "<br />")
    }
    </script>
    
    </body>
    </html>

    For...In 声明用于对数组或者对象的属性进行循环操作。

    for ... in 循环中的代码每执行一次,就会对数组的元素或者对象的属性进行一次操作。


    
    

    Meet so Meet. C plusplus I-PLUS....
  • 相关阅读:
    20200816
    20200815
    20200813
    20200811
    20200810
    20200806
    20200804
    20200803
    20200802
    20200801
  • 原文地址:https://www.cnblogs.com/iplus/p/4490013.html
Copyright © 2011-2022 走看看