Javascript using contructor inside in Array

This question already has an answer here:

  • Loop through an array in JavaScript 35 answers

  • here is a JsFiddle

    is that what you need ?

    for (var key in family) {
       var obj = family[key];
       for (var prop in obj) {
          alert(prop + " = " + obj[prop]);
       }
    }
    

    Here is the way to access the properties directly and not with a loop jsFIddle (Method 2, uncomment)

    链接地址: http://www.djcxy.com/p/24536.html

    上一篇: 使用javascript循环读取json数组数组

    下一篇: 在Array中使用内部构造函数的Javascript