This commit is contained in:
@@ -41,8 +41,12 @@ F. Scott Fitzgerald
|
||||
};
|
||||
|
||||
// JSON String
|
||||
const bookStr = JSON.stringify(book, '', 2);
|
||||
|
||||
console.log(bookStr);
|
||||
|
||||
// JS Object
|
||||
const bookObj = JSON.parse(bookStr);
|
||||
|
||||
console.log(bookObj.title); // => 'The Great Gatsby'
|
||||
console.log(bookObj.author); // => 'F. Scott Fitzgerald'
|
||||
|
||||
Reference in New Issue
Block a user