-1

次のようなオブジェクトを作成しました。

var courtdocument=    {
    'CFADocuments': {
        cv: [
            "CFA_Pack_Cover_Letter.docx",
            "Countersigned-CFA-Terms-and-Conditions-Letter.docx",
            "Test-cfa-documents - Copy - Copy.docx"
        ]
    },
    'LetterOfClaim': {
        cv: [
             "CFA_Pack_Cover_Letter.docx",
            "Countersigned-CFA-Terms-and-Conditions-Letter.docx"
        ]
    },
    'LetterOfInstruction': {
        cv: [
             "CFA_Pack_Cover_Letter.docx",
            "Countersigned-CFA-Terms-and-Conditions-Letter.docx"

        ]
    },
    Letters: {
        cv: [

        ]
    },
    'MedicalRecords': {
        cv: [

        ]
    },
    'medicalreports': {
        cv: [

        ]
    }
}

このセットはどうやって手に入れるのですか?

CFADocuments
LetterOfClaim
LetterOfInstruction
Letters
MedicalRecords
medicalreports
4

3 に答える 3

3

If you are looking for the different keys in the courtdocument obejct then in modern browsers you can use Object.keys() - IE < 9 not supported you can use a shim as shown in the mdn docs

console.log(Object.keys(courtdocument))

Demo: Fiddle

于 2013-11-06T09:21:49.123 に答える
0

If you want to get the set of values, try:

var result = []

for (var prop in courtdocument){
    if (courtdocument.hasOwnProperty(prop){
        result.push(courtdocument[prop])
    }
}
于 2013-11-06T09:21:37.303 に答える
0

courtdocument.CFADocumentsまたはを使用するだけですcourtdocument["CFADocuments"]

于 2013-11-06T09:20:41.170 に答える