0

I have returned somehow a JSON format of this form:

[ BinaryRow { id: 1, name: 'test', description: 'test' },
BinaryRow { id: 2, name: 'aa', description: 'bb' } ]

how can I access the values of specific keys using Javascript? I can not understand this format at all, thank you!

sofizh
  • 120
  • 9
  • 1
    JSON is a *textual notation* for data exchange. [(More here.)](http://stackoverflow.com/a/2904181/157247) If you're dealing with JavaScript source code, and not dealing with a *string*, you're not dealing with JSON. In this case, you're dealing with an array of objects whose constructor is `BinaryRow`. To access the `id` of the first one, you'd use `data[0].id` (where `data` is your variable referring to the array). But more likely, you'd [loop through the array](https://stackoverflow.com/questions/9329446/for-each-over-an-array-in-javascript/9329476#9329476) and use each object individually. – T.J. Crowder Jun 01 '19 at 14:14
  • Thank you really much for the answers – sofizh Jun 01 '19 at 14:16

0 Answers0