我有一个值数组
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"},
]
现在我必须删除条目测试[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中是否有任何功能,以获取此功能?
提前致谢
答案 0 :(得分:1)
我建议使用:
delete test[6]