Created
July 31, 2023 15:34
-
-
Save suhailgupta03/b90a7a9d41a6d7247ba941e82c357cfa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let student = { | |
name: 'manoj', | |
age: 20, | |
course: 'cse', | |
college: 'svec', | |
parentNameList: ['girish', 'samita'], | |
}; | |
var convertedToString = JSON.stringify(student); | |
// JSON is a string representation of an object | |
// In JSON the keys are always wrapped in double quotes | |
// and the values are either wrapped in double quotes or not | |
// This is also called serialization | |
console.log(convertedToString); | |
var convertedToObject = JSON.parse(convertedToString); | |
// This is also called deserialization | |
console.log(convertedToObject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment