I have data which is object which contains array , array further contains objects by default I have to store the value of first array's first object in a variable
here's my list
//data
object:{
fruits:[
{
name:"Apple",
color:"Red"
},
{
name:"Orange",
color:"Orange"
}
],
veggies:[
{
name:"Jackfruit",
color:"Muddy"
},
{
name:"Spinach",
color:"Green"
}
]
}
Tried to store value of fruits's first object in selected variable
Selected :object[0]
Store value in "selected" variable
object.fruits[0]
is what you need – Shubham Khatri Jan 17 at 9:31