1

I am facing a problem while fetching the particular array;

my json file

  • ATM/Cash ( each id from array(11) )

           -id:2998390918
           -id:2998390990
             .
             .
             .
           -id:2999363236
    
  • Account Transfer ( each id from array(30) )

           -id:2998390928
           -id:2998390929
             .
             .
             .
           -id:2998390979
    

    . . .

0

1 Answer 1

1

Loop over object and print

var o = {
    "Healthcare/Medical":
    Array(167),

        "Personal Care":
    Array(88),

        Miscellaneous_Services:Array(340),

        General_Merchandise:Array(110),

        Home_Improvement:Array(292)
};

Object.keys(o).forEach((k)=>{
    console.log(k);
    o[k].forEach((e)=>{
        console.log(`-id[${e.id}]`);
    });
});

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

2 Comments

This code brings me very close to the output. I want actual value of id
this is very helpful for me.Thank you So much @Shishir Arora

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.