how to list an array of objects
how would you "dump" the content of array of objects below
- function AttributeNodeClass(){
- this.name="";
- this.type="";
- this.description="";
- this.controls="";
- this.class="";
- }
- function AttributeIteratorClass(){
- this.attributeCatalog = new Array();
- this.add = function add(oAttributeNode){
- this.attributeCatalog.push(oAttributeNode);
- }//END function add(oAttribute)
- this.dumpThis = function dumpThis(){
- for(i=0: i< attributeCatalog.length; i++){
- console.log(attributeCatalog[i].name);
- }
-
- }//End function dumpThis()
- }//End AttributeIteratorClass()
- var one = new AttributeNodeClass();
- one.name="this";
- one.type="integer";
- one.class="circle";
-
- var two = new AttributeNodeClass();
- two.name="that";
- two.type="number";
- two.class="line";
-
- var three = new AttributeNodeClass();
- three.name="the other";
- three.type="stringr";
- three.class="rectangle";
-
- var catalog = new AttributeIteratorClass();
- catalog.add(one);
- catalog.add(two);
- catalog.add(three);
- catalog.dumpThis();
-