我正在尝试从数组中删除一个对象
删除数组[索引]
这是从数组中删除对象但是数组的 .length 属性仍然是 == 1
有任何想法吗?
PS 我正在尝试删除一个问题,例如 topic->questions[question_id]
if(topic_array[topic_id] !== 'undefined'){
if(topic_array[topic_id].questions.length > 0){
for(var i = 0; i < topic_array[topic_id].questions.length; i++){
if(topic_array[topic_id].questions[i].question_id == question_id){
delete topic_array[topic_id].questions[i];
console.log(topic_array);
}
}
}
}