我有下一个数组 json,我怎么读它?我已经试过了document.write(arr)
,它可以工作,但如果我把document.write(arr[0].Category)
它显示出来undefined
,
var arr = [{"Category":
{"cell":{"question1":{"que1":"What is the cell?"},
"option1":{"op1":"The cell is the basic structural and functional unit",
"op2":"is a fictional supervillain in Dragon Ball"},"answer1":"opt1"}}},
{"Category":{"Mars":{"question1":{"que1":"How many moons does Mars?"},
"option1":{"op1":"5","op2":"2"},"answer1":"opt2"}}}]
顺便说一下,数组很好,因为如果我这样做document.write(arr)
,它会返回相同的数组