Konwertuj ciąg na obiekt JavaScript
var mystr = '{ "hello":"world" }' // NB: Has enclosing ""
var myobj = JSON.parse(mystr);
Anxious Alligator
var mystr = '{ "hello":"world" }' // NB: Has enclosing ""
var myobj = JSON.parse(mystr);
var obj = {name: "Martin", age: 30, country: "United States"};
// Converting JS object to JSON string
var json = JSON.stringify(obj);
console.log(json);
// Prints: {"name":"Martin","age":30,"country":"United States"}
"https://www.tutorialrepublic.com/faq/how-to-convert-js-object-to-json-string.php"
var person={"first_name":"Tony","last_name":"Hawk","age":31};
var personJSONString=JSON.stringify(person);
JObject json = JObject.Parse(str);
<script>
// Convert JSON String to JavaScript Object
var JSONString = '[{"name":"Jonathan Suh","gender":"male"},{"name":"William Philbin","gender":"male"},{"name":"Allison McKinnery","gender":"female"}]';
var JSONObject = JSON.parse(JSONString);
console.log(JSONObject); // Dump all data of the Object in the console
alert(JSONObject[0]["name"]); // Access Object data
</script>
JSON.parse('{"name":"John", "age":30, "city":"New York"}')