Skip to content

Instantly share code, notes, and snippets.

@schesnowitz
Created February 18, 2023 07:24
Show Gist options
  • Save schesnowitz/16fee2df214b83933ad1fdd57876f448 to your computer and use it in GitHub Desktop.
Save schesnowitz/16fee2df214b83933ad1fdd57876f448 to your computer and use it in GitHub Desktop.
Objects
let library = [
{
title: "Shithouse",
author: "Some Guy",
status: {
own: true,
reading: false,
read: false
}
},
{
title: "Just a book title",
author: "John Doe",
status: {
own: true,
reading: false,
read: false
}
},
{
title: "My name is Jane Doe",
author: "Jane Doe",
status: {
own: true,
reading: false,
read: false
}
}
]
library[0].status.read
library[1].status.read
library[2].status.read
const {title: title} = library[0];
console.log(title);
const libraryJSON = JSON.stringify(library);
console.log(libraryJSON);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment