11 lines302 B
const book = { title: "Dune", author: "Frank Herbert", year: 1965, tags: ["sci-fi"] }; | |
| |
const { title, year } = book; | |
console.log(`${title} (${year})`); | |
| |
const text = JSON.stringify(book); | |
console.log(text); | |
| |
const copy = JSON.parse(text); | |
copy.tags.push("classic"); | |
console.log(book.tags, copy.tags); |