Javascript examples for JSon:JSon String
Cloning a JavaScript object vis Json Serialization
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// w w w . j a va 2 s . com var user = {name: "Foo", email: "bar@baz.com" } var user2 = JSON.parse(JSON.stringify(user)) user2.name = "Bar"; console.log(user.name + " " + user2.name); }); </script> </head> <body> </body> </html>