简体   繁体   中英

javascript array inside object inside array

I want an array of objects, and each object has a string, an array of strings and an integer...

Isn't this right?

var ques = [
    {
        "q": "quest1",
        "a": ["ans1", "ans2", "ans3", "ans4"],
        "c": 1
    },
    {
        "q": "quest4",
        "a": ["ans1", "ans2", "ans3"],
        "c": 3
    },
    {
        "q": "quest7",
        "a": ["ans1", "ans2"],
        "c": 2
    }
];

是的,那是一个有效的对象数组。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM