0
Where I use .JSON and JSON.parse() ??
Tell me where can I use this two thing ??
3 Antworten
+ 3
.json() is asynchronous and returns a Promise object that resolves to a JavaScript object. JSON.parse() is synchronous can parse a string and change the resulting returned JavaScript object.
AJAX works with callbacks and fetch api works with promises. so we use JSON.parse() to parse the response for AJAX and use json() to parse the response for fetch.
0
To Convert data -> javascript object