正当な JSON オブジェクトを解析し、多次元配列を調べて、最初に関数の引数に基づいて年を見つけ、次にその年の月を見つけています。
私のforループはネストされています:
    for (year in yearsData) {
        //If we've found the correct year...
        if (yearsData[year]['@attributes'].name == yearToGet) {
        //...walk through that year's child months
        for (month in yearsData[year]) {
            //This works!
            console.log(yearsData[year][month]);
            //This also works!
            console.log(yearsData[year][month]['@attributes']);
            //This does not work! ..but this is what I need!
            console.log(yearsData[year][month]['@attributes'].name);
        }       
   }
Firebug のコンソール (有効な出力) でオブジェクトを追跡できます。
console.log(yearsData[年][月]['@attributes']);
しかし、タイプを最後に追加した瞬間 (.name):
yearsData[年][月]['@attributes'] は定義されていません。
console.log(yearsData[年][月]); 有効なオブジェクトが返され、有効な @attributes がリストされていることがわかります。
スペルを何度も確認しました。何らかの形で年の属性と競合する場合に備えて、属性の名前を他の名前に変更しました..しかし、何も得られませんでした.
私が見逃している簡単なことは何ですか?
JSON:
{
"year": [
    {
        "@attributes": {
            "name": "2013"
        },
        "month": {
            "@attributes": {
                "name": "January"
            },
            "winner": "None!",
            "theme": "Nobody!"
        }
    }
]
}