我有一个值数组

var test =[];
test [1] = [
    {"myself":true,chat_user:11,"message":"Hi"},
    {"myself":true,chat_user:11,"message":"Evida"},
    {"myself":false,chat_user:11,"message":"yes"},
]

test [6] = [
    {"myself":true,chat_user:13,"message":"Hi"},
    {"myself":true,chat_user:13,"message":"Evida"},
    {"myself":false,chat_user:13,"message":"yes"},
]

test [9] = [
    {"myself":true,chat_user:22,"message":"Hi"},
    {"myself":true,chat_user:22,"message":"Evida"},
    {"myself":false,chat_user:22,"message":"yes"},
]


现在我必须删除条目test [6]并需要获取剩余的数组



 test [1] = [
        {"myself":true,chat_user:11,"message":"Hi"},
        {"myself":true,chat_user:11,"message":"Evida"},
        {"myself":false,chat_user:11,"message":"yes"},
    ]

    test [9] = [
        {"myself":true,chat_user:22,"message":"Hi"},
        {"myself":true,chat_user:22,"message":"Evida"},
        {"myself":false,chat_user:22,"message":"yes"},
    ]


节点js中有任何函数可以实现这一点?

提前致谢

最佳答案

我建议使用:

delete test[6]

09-13 13:21