crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>Convert a string into a function.</h2> <p id="demo"></p> <script> const text = '{"name":"Ahmed", "age":"function() {return 30;}", "city":"New York"}'; const obj = JSON.parse(text); obj.age = eval("(" + obj.age + ")"); document.getElementById("demo").innerHTML = obj.name + ", " + obj.age(); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+Q29udmVydCBhIHN0cmluZyBpbnRvIGEgZnVuY3Rpb24uPC9oMj4NCjxwIGlkPSJkZW1vIj48L3A+DQoNCjxzY3JpcHQ+DQpjb25zdCB0ZXh0ID0gJ3sibmFtZSI6IkFobWVkIiwgImFnZSI6ImZ1bmN0aW9uKCkge3JldHVybiAzMDt9IiwgImNpdHkiOiJOZXcgWW9yayJ9JzsNCmNvbnN0IG9iaiA9IEpTT04ucGFyc2UodGV4dCk7DQpvYmouYWdlID0gZXZhbCgiKCIgKyBvYmouYWdlICsgIikiKTsNCmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0gb2JqLm5hbWUgKyAiLCAiICsgb2JqLmFnZSgpOyANCjwvc2NyaXB0Pg0KDQo8L2JvZHk+DQo8L2h0bWw+