JQuery and ES6 Industrial Training

JSON format of object

<script>

      let student = {

        name: “shairy”,

        age: 30,

        isAdmin: false,

        courses: [“html”, “css”, “js”],

        wife: null,

      };

      let json = JSON.stringify(student);

      alert(typeof json); // we’ve got a string!

      alert(json);

      let jobj = JSON.parse(json);

      alert(jobj.name);

</script>


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *