new class js -advanced
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const book = {
|
||||
title: 'The Great Gatsby',
|
||||
author: 'F. Scott Fitzgerald',
|
||||
year: 1925,
|
||||
};
|
||||
|
||||
const jsonString = JSON.stringify(book);
|
||||
console.log(jsonString);
|
||||
|
||||
const jsonObject = JSON.parse(jsonString);
|
||||
console.log(jsonObject.title);
|
||||
console.log(jsonObject.author);
|
||||
Reference in New Issue
Block a user