Understanding For-in Loop

This is where good indentation is key.

var test = {
    "key1": val1,
    "key2": [
        {
            "a":1,
            "b":[{},{}]
        },
        {
            "a":1,
            "b":[{},{}]
        }
    ]
};

Here you can clearly see that it in fact has 2 items.

Leave a Comment