1

I have the following code in my javascript:

 fetch(Url).then(r => r.json())
.then(data => console.log(data))
.catch(e => "failed")

I am looking for a way to returned the JSON.parse(data) instead of just logging it to the console. I am specifically looking to retrieve the Name value from the json returned

I have tried below with no success:

.then(data => obj = JSON.parse(data))

Any help to return just the obj.Name from the Json data returned would be appreciated.

Darthchai
  • 757
  • 8
  • 17

0 Answers0