Started by James CharlesSep 4, 2021

Open
How to get all indexes of json file

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

I would like to make random background images. For example, when burger selected from the picker, pictures will be shown inside of this json file. But first i need to reach all indexes of data, could you please help me how to do it?

const data = {
"1": {
name: "Burger",
price: 599,
picture: [
{
"description": "Tasty",
"file": "https://cdn.auth0.com/blog/whatabyte/burger-sm.png"
},
{
"description": "Beef",
"file": "https://cdn.auth0.com/blog/whatabyte/burger-sm.png"
}
]
},
"2": {
name: "Pizza",
price: 299,
picture: [
{
"description": "Cheesy",
"file": "https://cdn.auth0.com/blog/whatabyte/pizza-sm.png"
},
{
"description": "Salty",
"file": "https://cdn.auth0.com/blog/whatabyte/pizza-sm.png"
}
]
},
"3": {
name: "Tea",
price: 199,
picture: [
{
"description": "Informative",

0 Replies

You must be Logged in to reply
Techiio

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

facebooklinkdeintwitter

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Copyright techiio.com @2020 Kolkata, India
made with by Abhishek & Priyanka Jalan
Copyright techiio.com @2020
made with by Abhishek & Priyanka Jalan