How to access an array in a JSON object?

后端 未结 8 1004
感动是毒
感动是毒 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:15

    That's because your base object is an array as well.

    console.log(dataJS[0].comments[0]);
    

    I suspect that would work

提交回复
热议问题