The basic premise for iterating over objects in JavaScript is like so
var whatever = {}; // object to iterate over
for ( var i in whatever )
{
if ( whatever.hasOwnProperty( i ) )
{
// i is the property/key name
// whatever[i] is the value at that property
}
}
Fixing up a checker wouldn’t be too hard. You’ll need recursion. I’ll leave that as an exercise for you or another SOer.