How to access an array in a JSON object?

后端 未结 8 988
感动是毒
感动是毒 2020-12-15 05:35

I have the following JSON object:

[
    {
        "comments": [
            {
                "created_at": "2011-02-09T14:42:42-08:0         


        
8条回答
  •  北海茫月
    2020-12-15 06:16

    The object being returned is itself an array, so to get to the first comment (as an example), this is how you would access it:

    dataJS[0].comments[0]

提交回复
热议问题