crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>Convert a string into a date object.</h2> <p id="demo"></p> <script> const text = '{"name":"Ahmed", "birth":"1986-12-14", "city":"New York"}'; const obj = JSON.parse(text, function (key, value) { if (key == "birth") { return new Date(value); } else { return value; } }); document.getElementById("demo").innerHTML = obj.name + ", " + obj.birth; </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+Q29udmVydCBhIHN0cmluZyBpbnRvIGEgZGF0ZSBvYmplY3QuPC9oMj4NCg0KPHAgaWQ9ImRlbW8iPjwvcD4NCg0KPHNjcmlwdD4NCmNvbnN0IHRleHQgPSAneyJuYW1lIjoiQWhtZWQiLCAiYmlydGgiOiIxOTg2LTEyLTE0IiwgImNpdHkiOiJOZXcgWW9yayJ9JzsNCmNvbnN0IG9iaiA9IEpTT04ucGFyc2UodGV4dCwgZnVuY3Rpb24gKGtleSwgdmFsdWUpIHsNCiAgaWYgKGtleSA9PSAiYmlydGgiKSB7DQogICAgcmV0dXJuIG5ldyBEYXRlKHZhbHVlKTsNCiAgfSBlbHNlIHsNCiAgICByZXR1cm4gdmFsdWU7DQogIH0NCn0pOw0KZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImRlbW8iKS5pbm5lckhUTUwgPSBvYmoubmFtZSArICIsICIgKyBvYmouYmlydGg7IA0KPC9zY3JpcHQ+DQoNCjwvYm9keT4NCjwvaHRtbD4=