Return to Snippet

Revision: 43225
at March 19, 2011 17:40 by anagaiyahoocom


Initial Code
//two level object literal
var valid = {
	fName : {
		req : true,
		max : 6
	},
	lName : {
		req : true,
		max : 10
	}
}


var fld;

//fld is text value of object key
for(fld in valid)
{
   
   console.log(valid[fld].req);
}


//Will display
true
true
23

Initial URL

                                

Initial Description

                                

Initial Title
Looping Through Javascript Object

Initial Tags
javascript

Initial Language
JavaScript