Javascript Json

technical talkiess
0

 Javascript Json :- 


<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Javascript math function  </title>

</head>


<body>

    <div class="container">

        This is json tutorial

    </div>

    <script>

        let JsonObjectHere = {

            name:"Vishal",

            age:23,

            address:"Cidco Aurangabad",

            MobileNo:9860210840

        }


        console.log(JsonObjectHere);


        // object ko agar json me convert karn hai to .... json stringfy function convert object into the string

        jsonConvertedString = JSON.stringify(JsonObjectHere);


        console.log(jsonConvertedString);



        // agar apko replace karna hai kisi proprty ko to aap

        jsonConvertedString = jsonConvertedString.replace('Vishal','lakhan');


        console.log(jsonConvertedString);


        // agar isko parse karna hai .... json ko


        newParseJson = JSON.parse(jsonConvertedString);


        console.log(newParseJson);


    </script>

</body>

</html>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)