-1

I have made an object like:

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: [

        ]
    }
}

How will I get this set?

CFADocuments
LetterOfClaim
LetterOfInstruction
Letters
MedicalRecords
medicalreports
JJJ
  • 32,902
  • 20
  • 89
  • 102
Rituraj ratan
  • 10,260
  • 8
  • 34
  • 55

3 Answers3

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

Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
0

You simply need to use courtdocument.CFADocuments or courtdocument["CFADocuments"]

Satpal
  • 132,252
  • 13
  • 159
  • 168
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])
    }
}
pax162
  • 4,735
  • 2
  • 22
  • 28