I am learning mootools. I have an array in following format.
I want to traverse it in for loop but dont know how to do it.
{'apple' : { 'prize' : 10 , 'color' : 'Red' } ,
'banana' : { 'color' : 'red', 'prize' : 20, 'quantity' : 12 } }
I am getting above structure of array from another module thats why i cant change its structure.
Those are objects, not arrays.
Example: http://jsfiddle.net/AkVvY/
You don’t need a library for this.
If you’re concerned that there may be additions to
Object.prototype, then do this:Example: http://jsfiddle.net/AkVvY/1/