I have a json array and I need to alert a value in it.
The object looks like this:
Test = [
{
"adj" : [
{
"nodeTo" : "x",
"nodeFrom" : y,
"data":
{
"$type" : "line",
"$color" : "#A989BC",
"$value" : "number"
}
}
],
"id" : "id1",
"name" : "name1"
},
{
"adj" : [ ..... ] // I have many element in the Test array
What I want is to alert the value existed in the “data” array which exists in the “adj” array.
I tried this:
alert(Test[0]["adj"]["data"]["value"]);
But it isn’t working.
Thanks in advance:)
adj is an array: