Adding elements to object

前端 未结 17 2216
有刺的猬
有刺的猬 2020-12-02 04:11

I need to populate a json file, now I have something like this:

{\"element\":{\"id\":10,\"quantity\":1}}

And I need to add another \"elemen

17条回答
  •  半阙折子戏
    2020-12-02 04:34

    you should write var element = [];
    in javascript {} is an empty object and [] is an empty array.

提交回复
热议问题