我正在尝试使用
从数组中删除对象删除数组[index]
从数组中删除对象,但数组的.length属性仍为== 1
有什么想法吗?
PS我正试图删除一个问题,例如topic->问题[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);
}
}
}
}