-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
3
  • What is the question exactly ? Commented Nov 6, 2013 at 9:20
  • Please refer to this : stackoverflow.com/questions/558981/… Commented Nov 6, 2013 at 9:22
  • i want to get CFADocuments and etc all key values Commented Nov 6, 2013 at 9:22

3 Answers 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

Sign up to request clarification or add additional context in comments.

3 Comments

Note, of course, that browsers that don't support Object.keys can easily be shimmed.
@lonesomeday then how will i handle this
@Riturajratan By clicking on that link and doing what it says?
0

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

Comments

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])
    }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.