I'm trying to remove an object from an array with
delete array[index]
which is deleting the object from the array however the .length property of the array is still == 1
Any ideas?
PS I'm trying to delete a question e.g. 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);
}
}
}
}