I have a JSON object like [{'123':{'ID':'123','name':'abc'}}]
.
How to read name field.
Asked
Active
Viewed 27 times
0

Sachin Singh
- 61
- 1
- 7
-
I have updated my question – Sachin Singh May 30 '18 at 00:11
-
FYI this is JavaScript, not JSON. At any rate, try this in a JavaScript console: `const a = [{'123':{'ID':'123','name':'abc'}}]; console.log(a[0]['123'].name);` – Ray Toal May 30 '18 at 00:13
-
You do not understood my question, suppose we do not know the ID that is if I am having 100 objects like this then how I can iterate through it to read name. – Sachin Singh May 30 '18 at 00:18
-
You're right; there was no way to know that you had "100 objects like this." Anyway, someone closed your question. Did the duplicate answer help you? – Ray Toal May 30 '18 at 05:53
-
No It did not helped me. – Sachin Singh May 30 '18 at 15:35
-
Bummer. Well your best bet is to write a new question and be very specific that you have a list of items. In the example show more than one item in the list. Show exactly the list you are given and exactly what you expect in return. – Ray Toal May 30 '18 at 16:42
-
Happy to help, feel free to let me know where the new question is if you don't get an answer. – Ray Toal May 31 '18 at 05:21
-
Thank you Sir, I will share my question with you. – Sachin Singh May 31 '18 at 06:30