-1

My resultjson's content:

[{"name":"Dummy","id":"780828872962080819","sync_code":123456,"expiration":"2021-04-07T14:03:34.000Z"}]

I need the "name" from the JSON as a String, i tried with JSON.parse(resultjson).name but it didnt work.

1 Answers1

1

It's an array. You need to access an element:

JSON.parse(resultjson)[0 /* or other element */].name
0xLogN
  • 3,289
  • 1
  • 14
  • 35